How a request is handled
What happens in the fraction of a second between an app sending a message and getting an answer. You can see each of these steps for any request: open it in Requests and look at the Decision trace.
- Identify
The API key tells the gateway which app is calling, which team owns it and which governance profile applies. Unknown, revoked or expired keys are refused.
- Classify
Every message is scanned for health data, personal details, card numbers, secrets, government-controlled and confidential data, using patterns, checksums and clinical context. The app can also declare data with the X-AIGov-Sensitivity header.
- Redact
Sensitive values are replaced with typed placeholders before the request leaves, so the model still understands the task.
- Policy
Your ordered rules and compliance frameworks decide what is allowed. Anything no rule allows is denied.
- Risk
Prompt-injection checks, optional guardrail models and a risk score decide whether to allow, hold for review or block.
- Route
The request goes to the best destination your rules allow for this data, with fallbacks if one is unavailable.
- Verify
The gateway checks which model actually answered. If it isn't one the policy allowed, the request fails closed.
- Meter
Tokens and cost are recorded per team, workload and person, against budgets and plan limits.
- Audit
The decision and its reasons are written to a hash-chained log that shows if anyone alters it.
An example
A clinical note app using the HIPAA · Clinical profile asks for gpt-4o to summarise "Patient John Carter, MRN 00482913, chest pain…".
- The gateway finds health data, so the rule
health-data-on-prem-firstapplies. - HIPAA only allows on-prem models or providers with a signed BAA, so the request is redirected to your on-prem Llama model.
- Because it stays in your data centre, the record number isn't redacted.
- The answer comes back as normal. The response headers say what happened:
X-AIGov-Decision: redirectandX-AIGov-Model: llama-3.1-70b.
Decisions
| Decision | What happened |
|---|---|
allow | Sent to the model the app asked for. |
redirect | Policy didn't allow the requested model for this data, so an allowed one answered. X-AIGov-Model names it. |
deny | Refused with HTTP 403. The error message names the reason and the request ID. |
held | Waiting for a person to approve it under Approvals (HTTP 403, held_for_review). |