Chat on WhatsApp

How do I avoid leaking Magento admin tokens to the LLM?

Treat tokens like Kubernetes secrets, not like configuration. The admin token lives in the Docker container’s env file (/run/secrets/magento_admin_token or .env.mcp), is read once at startup, and is never passed as a tool argument. The LLM sees tool inputs (SKU, query, date range) and outputs (the data), it does not see the token. Common mistakes to avoid: (a) making admin_token a tool parameter so the model can “help” with auth; (b) logging the Authorization header; (c) returning the integration object verbatim from a tool. Use the narrowest integration scope possible, if the LLM only needs to read orders, the token should only grant that.

Was this helpful?