Agent policies belong at the edge, not in system prompts
A common way to ship an internal AI workflow is to hand the agent a credential in .env, add a paragraph to the system prompt ("only read from Stripe, never issue refunds over $500, always check with a human first"), and call it governed.
That holds together for a single demo. It breaks down the moment a real team uses more than one tool.
Why prompt rules and app-code checks do not scale
Prompt instructions are suggestions to a probabilistic model, not access control. Even when a model follows them 99 times out of 100, a prompt injection from a support ticket, a customer email, or a vendor payload only needs to work once.
Moving the check into one application's wrapper code is better, until you look at how people actually work across a company:
- Engineering uses Claude Code and Cursor.
- Support and sales use Claude or ChatGPT.
- CI and internal jobs call the same APIs over HTTP.
If your rules live inside one app or one harness config, every new client either duplicates the rules or bypasses them completely. Worse, changing who can call what requires a code deploy—so access policy ends up owned by whoever maintains the app instead of the team responsible for security and ops.
What belongs at the edge instead
Access policy should live in one place, outside every model and outside every client, directly on the path between callers and your systems.
- Least privilege by default. A new API source starts read-only (
GETandHEAD). Allowing a write is an explicit rule you add by method and path—POST /v1/invoicesfor the Finance group, nothing for everyone else. Anything outside the rule set is refused before it reaches your system. - Group-based access, capped by the person. Groups decide who can see a source and which calls they may make. When a teammate connects Claude or Cursor, they choose read-only, a subset of calls, or everything they hold—an agent never gets more access than the person running it.
- Purpose-labeled sessions across every system. Before touching a source, the agent states what the run is for. Every query, MCP tool call, API request, write, and refusal lands in one timeline under that person and purpose, and one click revokes every live key that session holds.
- Concurrency limits and queuing under load. Policy is not only whether a call is allowed; it is how many may run at once. Hard per-source concurrency limits, FIFO queuing, and shared origin capacity budgets keep a busy swarm of agents from tripping vendor rate limits or crowding out production traffic.
Deterministic beats clever
When a CTO asks "can this agent delete an order in NetSuite?" or "what happens when someone leaves the company?", the answer should not depend on which model version is running today or whether someone remembered to edit a prompt file.
Put the credentials, the allow-lists, the group rules, and the concurrency limits at the edge. Let teams pick whichever AI client makes them fastest, knowing every call from every client passes the same four checks before it touches your systems.