AI Security
Scoping API Keys and Service Tokens for AI Agents in No‑Code Automation Platforms
TL;DR: Treat every AI‑agent integration as a separate micro‑service. Create a dedicated API key or token for each agent, limit it to the exact endpoints it needs, set short expiration times, and enforce IP‑allow‑lists or workspace‑level scopes. Zapier, Make, and n8n all let you generate scoped credentials; use them instead of sharing a master key.
Why token scoping matters for no‑code AI agents
No‑code platforms make it easy to wire together LLM calls, database queries, and third‑party services. That convenience can mask a dangerous assumption: a single, all‑powerful API key can be reused across dozens of flows. If one flow is compromised, the attacker inherits every permission attached to that key. Applying the principle of least privilege reduces the blast radius and simplifies incident response.
What kinds of credentials do Zapier, Make, and n8n support?
- Zapier: Zapier’s Agents documentation shows that each agent can be configured with an
API Keyor anOAuth 2.0 token. The platform stores the credential in a private connection that can be shared with specific Zaps only. - Make (formerly Integromat): Make uses connections that hold API keys, bearer tokens, or service‑account JSON files. Connections can be limited to a particular scenario (the equivalent of a workflow) and to a set of modules within that scenario.
- n8n: n8n stores credentials in its
Credentialsstore. Each credential can be scoped to a specific node type (e.g.,OpenAI,Google Sheets) and can be marked as private so only the workflow that created it can use it.
Step‑by‑step: Create a scoped key for a Zapier AI agent
- Log in to the service that the agent will call (e.g., OpenAI, Stripe, or your internal API).
- Generate a new API key with the narrowest possible permission set. For OpenAI, use a
custom rolethat only allowschat.completionsandembeddings.curl -X POST https://api.openai.com/v1/organization/roles \ -H "Authorization: Bearer $MASTER_KEY" \ -d '{"name":"zapier‑assistant","permissions":["chat.completions","embeddings"]}' - Copy the newly created key and go to Zapier → My Apps → Add connection. Choose the appropriate app (e.g., OpenAI) and paste the scoped key.
- When you build the Agent, select the connection you just created. Zapier will automatically hide the key from other Zaps.
- Set an expiration policy in your API provider (most providers let you rotate keys every 30‑90 days). Document the rotation schedule in a shared spreadsheet.
How to limit token scope in Make.com scenarios
Make does not have a built‑in “expire after X days” feature, but you can emulate it with a scenario that rotates credentials:
- Create a Credentials object for the target service with the minimal permission set.
- Add a HTTP module at the start of the scenario that calls the provider’s
rotate‑keyendpoint. Store the new key in a Variable. - Pass the variable to subsequent modules using the
{{variable}}syntax. This way the scenario always uses the freshest key. - Schedule the scenario to run once a day (or weekly) to keep the key rotating automatically.
Make’s AI Agents documentation notes that each agent can reference only one connection, so you can safely isolate each agent’s credentials.
n8n: Using private credentials for per‑workflow isolation
In n8n, the Credentials UI lets you toggle “Execute Once” which stores the secret in an encrypted vault tied to the workflow file. Follow these steps:
- Create a new credential (e.g.,
OpenAI API) and select Scope: Workflow.{ "apiKey": "sk‑scoped‑z7…", "permissions": ["chat.completions"] } - Attach the credential to the
OpenAInode inside your AI agent workflow. - Enable “Private Execution” in the workflow settings. n8n will refuse to run the workflow if the credential is missing or mismatched.
- For added safety, set
executionTimeoutandmaxConcurrentRunsto limit exposure.
Common pitfalls and how to avoid them
- Re‑using a master key across agents. Always generate a new key per agent; treat each key as a separate micro‑service account.
- Granting “admin” or “owner” roles. Review the provider’s permission matrix; most actions (completion, search, file upload) have dedicated scopes.
- Storing keys in plain‑text environment variables. Use the platform’s secret store (Zapier connection, Make Credentials, n8n encrypted vault) instead of .env files.
- Neglecting rotation. Automate rotation where possible; at minimum set calendar reminders.
- Missing audit trails. Enable request logging in the API provider and capture the
X‑API‑Key‑IDheader in your workflow logs.
Putting it all together: A checklist for each new AI agent
- Identify the exact external APIs the agent will call.
- Create a dedicated service account or API key with only those scopes.
- Store the credential in the platform‑specific secret store.
- Configure the agent to reference that secret exclusively.
- Set an expiration/rotation policy (30‑90 days).
- Enable logging of the credential identifier for audit purposes.
- Test the agent with a revoked key to verify that failure is graceful.
Following this checklist turns a “one‑key‑fits‑all” setup into a series of isolated, auditable components—exactly what NIST’s AI Risk Management Framework recommends for small enterprises.
FAQ
- Do I need to rotate keys if I use short‑lived OAuth tokens? Yes. Short‑lived tokens reduce risk, but if a token is leaked before expiry it still grants full access. Rotate them regularly and store refresh tokens securely.
- Can I share a single credential across multiple agents? Only if the agents need identical permissions. Otherwise, create separate credentials to keep the blast radius minimal.
- What if my provider does not support granular scopes? Use network‑level controls (IP allow‑lists, VPC service controls) to limit where the key can be used.
- How do I audit which agents used which keys? Enable request‑level logging on the API provider and include the
X‑API‑Key‑ID(or equivalent) in the payload logged by Zapier/Make/n8n. - Is it safe to store keys in GitHub Actions for CI testing? No. Use GitHub Secrets and limit the secret’s access to a dedicated test account with read‑only permissions.
Need a practical AI security review?
AISecAll reviews prompts, tool permissions, document flows, and agent behavior so small teams can use AI without guessing where the risk sits.