The architecture review at Highveld Mutual, a fictional South African insurer, took forty minutes to reach the real disagreement. The platform team wanted to buy an AI gateway "to govern AI". The claims team wanted an agent that drafts settlement recommendations and updates the claims system. The security lead asked one question: when the agent tries to change a claim, which component says no? Three people pointed at the gateway. None of them was right.
The gateway governs access to intelligence. The agent harness governs how intelligence becomes action. The application remains accountable for the business outcome. Those are different jobs, and they sit at different boundaries in the same request. Products overlap, vendors bundle, and a single box on a slide can hide all of them. The responsibilities do not merge just because the logos do.
CloudNala has already covered the gateway itself in depth, in The Model Gateway Is Not the AI Platform, including the distinction between AI gateways, API gateways and agent gateways. This part does not repeat that explanation. It gives you the map the rest of this series hangs from: four boundaries in one request, and a matrix that says which boundary owns which control.
Four boundaries in one request
Follow a single request at Highveld Mutual. A broker asks the claims assistant to prepare a settlement recommendation for a hail-damage claim.
- The API gateway sits at the service edge. It authenticates the calling application, applies traffic limits and exposes only the APIs that are meant to be public. It knows a request arrived. It does not know what a claim is.
- The application and domain layer owns the business. It knows the broker, the policy, the claim, the settlement limits and who may approve what. It holds the system of record.
- The agent harness runs the loop around the model: it builds context, calls the model, checks each proposed step, runs tools within budgets and decides when to stop. Part 2 covers it in detail.
- The AI gateway sits between the harness and the model providers. It routes to approved models, applies fallback, enforces shared prompt and response policy and records token usage.
The dashed line in the diagram is the one most designs leave out. When the harness wants to update the claim, it does not call the claims database directly. It proposes a tool call, and the application decides whether this broker, on this claim, in this state, may do that. The model's suggestion is input to that decision, never a substitute for it.
The responsibility matrix
Use this matrix in design reviews. "Primary" means this boundary owns the control and its evidence. Other entries describe a supporting role.
| Concern | API gateway | AI gateway | Agent harness | Application and domain |
|---|---|---|---|---|
| Authentication at the service edge | Primary | Inherits identity, or authenticates the harness | Consumes the user's identity | Defines user and domain context |
| Traffic protection and rate limits | Primary | Model-specific token limits | Step, tool-call and cost budgets per task | Business quotas |
| Model routing and fallback | No | Primary | May request a capability, not a specific model | Defines what outcome is acceptable |
| Prompt and response policy | Limited | Primary for shared policy | Task-specific policy | Domain-specific rules |
| Tool selection and invocation | No | No | Primary | Authorises the business capability |
| Memory and task state | No | No | Primary for task state | Owns durable business state |
| Human approval | No | No | Orchestrates the pause and resume | Owns who may approve |
| Transaction integrity | No | No | Assists (idempotency keys, checkpoints) | Primary |
| Model cost attribution | Supports | Primary telemetry | Adds task and case context | Owns the budget outcome |
| Evaluation | Traffic and contract tests | Model and policy tests | Agent trajectory tests | Business acceptance |
Two rows deserve a second look. Human approval is split on purpose: the harness knows how to pause a run and resume it with the approver's decision, but the application decides who is allowed to approve a R180,000 settlement. And transaction integrity is not a harness job at all. The harness can help with idempotency keys and checkpoints, but the claims system must refuse a duplicate payment whatever the agent believes it is doing.
Three rules that fall out of the matrix
Authorisation stays in the application
An AI gateway can check that the harness may call a model. It cannot check that this broker may settle this claim, because it does not hold the policy, the claim or the delegation of authority. OWASP's guidance on LLM06:2025 Excessive Agency makes the same point from the security side: limit what extensions can do, use least-privilege and user-scoped credentials, and enforce authorisation in downstream systems rather than relying on the model to decide.
In practice, that means every tool the agent can call maps to an application capability with its own permission check. A tool call is a proposal until the application validates it. CloudNala's article on why a tool gateway is a control point, not a trust boundary covers the same principle for tool traffic.
Model fallback is not business continuity
When the primary model is throttled, the AI gateway can route to a second approved model. That keeps the model call alive. It does not keep the claims process alive if the claims system is down, if the identity provider is unavailable, or if the substitute model has not been evaluated for settlement recommendations. Model fallback is one recovery option among several. Part 7 covers the rest, and who owns the retry covers the layering problem when every boundary retries on its own.
The meter is not the ledger
AI gateways are good at counting tokens, and that telemetry is the best place to start cost attribution. It is still a meter, not a ledger. As a dated example, Microsoft's documentation for the llm-token-limit policy in Azure API Management (checked on 18 November 2026) explains that:
- token counts are estimated when responses are streamed;
- concurrent requests can temporarily take usage past the limit;
- counters are kept per gateway rather than aggregated across regions.
None of that is a flaw. It is the honest behaviour of a control in the data path. It does mean the budget outcome belongs to the application, which knows which claim, which product line and which customer the spend served. Virtual keys are an accountability mechanism explains how to connect the two.
One product, several boundaries
Vendors package these responsibilities differently, which is why the matrix has to be about responsibilities rather than products. As dated examples, all checked on 18 November 2026:
- Azure API Management describes its AI gateway capabilities as an extension of its existing API gateway, covering model APIs, MCP servers and agent-to-agent APIs. Its MCP server support covers tools only, not MCP resources or prompts. One product spans the API gateway and AI gateway columns.
- Kong AI Gateway describes itself as a governance layer for model, MCP and agent-to-agent traffic. Version 2.x moves from AI plugins to a new entity model, and some features, such as semantic caching, are part of the enterprise offering.
- LiteLLM, now branded as an AI gateway, is a self-hosted, OpenAI-compatible endpoint with virtual keys, budgets, fallbacks and retries. Audit logs, team budgets and single sign-on beyond five users need a paid licence.
- Portkey publishes an open-source gateway with a managed option. Its plan to merge its enterprise gateway into the open-source project was a pre-release when we checked.
When one product sits across two columns, write down which configuration enforces which row of the matrix, and who owns that configuration. "The platform handles it" is not an owner. The product names will change. The questions in the matrix will not.
Centralisation has a cost
A shared AI gateway is attractive because it puts policy in one place. That is also its risk.
- It becomes a failure domain. Every AI-enabled process now depends on it. Its availability target needs to be at least as high as the most critical process behind it, and someone must decide, policy by policy, whether it fails open or closed.
- It becomes a queue. If every new model, guardrail or route needs a ticket to one central team, product teams will route around the gateway. Give teams self-service within guardrails, and keep central ownership of the guardrails.
- It becomes a hiding place. Policy that lives only in a gateway configuration is invisible to the application team that answers for the outcome. Publish the shared policy, version it, and test it like code.
CloudNala's earlier warning still applies: do not add a gateway without a requirement. Two applications calling one model provider may not need one yet. Several teams, several providers and a cost or data-residency obligation usually do.
What never belongs in a prompt
Some controls are tempting to write into the system prompt because it is quick. They are never safe there, at any boundary:
- Secrets. Credentials in context can be repeated, logged or extracted. They belong in the tool runtime, scoped to the call. Part 6 maps where they leak.
- Tenant boundaries. "Only use documents from Highveld's commercial book" is a hope. A filter applied during retrieval is a control.
- Transaction validation. "Never approve more than R50,000" is a sentence the model may or may not follow. A limit enforced by the claims system is a rule it cannot break.
A prompt is guidance for the model. A control is something that holds when the model ignores the guidance.
The South African version of the question
At Highveld Mutual, the matrix also settles two arguments that are specific to its context.
First, where personal information may go. Claims data includes personal information under the Protection of Personal Information Act (POPIA). Which model providers, in which regions, may receive which classes of data is a shared policy, and the AI gateway is a sensible place to enforce routing to approved endpoints. But the purpose for processing, the minimum data needed for this task and the decision about whether a cross-border transfer is justified belong to the application and the information officer. A gateway rule cannot supply a lawful basis. This is general information, not legal advice. Part 6 covers the data questions in more detail.
Second, who pays. Usage-based model pricing is often quoted in US dollars, so a rand budget moves with the exchange rate as well as with usage. Gateway telemetry shows the tokens. Only the application can say that a given spike was 900 extra hail claims after a storm in Gauteng, which is a cost the business accepts, rather than a looping agent, which it does not.
Use the matrix in your next architecture review
Before approving an AI design, ask these questions and record the named answer, not the product:
- Where is the user's identity established, and how does it reach the harness and the tools?
- Which component refuses a tool call that the user is not allowed to make?
- Which component owns the business transaction, and how does it reject a duplicate?
- Which policies live in the AI gateway, who owns them, and does each one fail open or closed?
- What happens to the business process when the model, not just the model call, is unavailable?
- Where does the budget outcome sit, and can a cost spike be traced to a case?
- Which tests prove each primary control in the matrix actually works?
If two questions get the same product as an answer, check that the product really owns both rows, and that someone owns its configuration.
Next: Part 2, The model proposes. The harness decides what happens next. All parts are on the series page.
How CloudNala can help
CloudNala runs control-boundary reviews for AI systems that are about to move from pilot to production. We trace real requests through your API gateway, AI gateway, agent runtime and business applications, complete the responsibility matrix against what is actually configured, and test the controls that matter most: tool authorisation, duplicate-transaction protection, fallback and cost attribution. You leave with the matrix filled in for your estate, the gaps ranked by risk, and the owner for each one.
Work with CloudNala
CloudNala helps organisations move from technology ambition to practical execution across cloud, AI, data, platform engineering and digital services.
Whether you are exploring AI, modernising your cloud environment, building a public-sector digital service, or turning an idea into a working MVP, we can help you shape the roadmap and deliver the next step.
Book an AI Control Boundary Review or write to us at consult@cloudnala.co.za
