- An AI compliance framework for LLM applications has four working parts: an inventory of every model call, rules a machine can evaluate per request, one control point that enforces them, and logs that prove each rule ran.
- A rule is usable only when it names its scope, trigger, action, owner, and evidence source. "Protect customer data" is a goal; "redact email addresses from prompts sent to providers outside the EU" is a rule.
- Enforcing rules at one gateway gives a single place to prove they ran, but only after provider keys are revoked from applications and direct egress to provider APIs is blocked.
- Bifrost, an open-source AI gateway, signs each audit log entry with HMAC-SHA256 and verifies entries through an API endpoint, which answers an auditor's question about whether logs were altered.
- As of November 23, 2026, the EU AI Act's stand-alone high-risk obligations apply from December 2, 2027, after the AI Omnibus moved them from August 2026.
An AI compliance framework is the set of processes and controls that turns legal and policy obligations into checks that run on real AI traffic. For an LLM application that means four pieces of work done in order: inventory every model, app, and data flow; write policies as rules a machine can check; enforce those rules at one control point; and collect evidence that they ran. This guide covers each step with the artifacts it should produce, then lays out a phased rollout where every phase ends on a pass condition. It uses Bifrost, an open-source AI gateway, as the concrete example for enforcement and evidence.
This article assumes the rules already have a purpose behind them. For the principles those rules come from, see AI governance principles, and for how governance and compliance divide the work, see AI governance and compliance.
#What an AI compliance framework covers
An AI compliance framework covers every path by which data reaches a model and every path by which model output reaches a person or a system. Regulations differ in detail, but they ask the same four questions of each path: what is it, who may use it, what may pass through it, and how is that proven.
| What to control | Example risk | Where the control sits |
|---|---|---|
| Models and providers | A model hosted in a region the data may not leave | Model allowlist and routing |
| Prompts | Customer records or secrets sent to a provider | Input guardrails and redaction |
| Responses | Personal data or unsafe content returned to a user | Output guardrails |
| Tool calls | An agent writing to a production system without approval | Tool allowlists, approval steps |
| Credentials | A provider key in a repository, used outside any policy | Scoped keys, revocation, egress rules |
The order of the steps matters. A team that buys a guardrail product before it knows which apps call which models finds, later, traffic that never passed through it.
The established frameworks give the vocabulary for this work. The NIST AI Risk Management Framework, released January 26, 2023 and under revision as of November 2026, organizes it into four functions: Govern, Map, Measure, and Manage. ISO/IEC 42001 defines a certifiable AI management system. Neither tells an engineering team which log field proves a redaction ran, which is the gap the four steps below fill.
#Step 1: Inventory models, apps, and data flows
The inventory is a register with one row per model integration, and it sets the scope for everything after it. A model call that is not in the register has no rule covering it and no evidence for it.
Record these fields for each row:
- the owning app or team, with a named person
- provider, model, region, and deployment type (provider API, cloud-hosted, or self-hosted)
- the data classes that enter prompts: public, internal, confidential, personal, or regulated
- whether prompts and responses are stored, where, and for how long
- whether the model can call tools, and which systems those tools reach
- the credential the integration uses, and who can rotate it
- the business purpose, in one sentence
Then draw each app's data flow: from the source (a CRM record, a support ticket, an uploaded file) through application code, into the prompt, out to the provider, and back into a response or a database. Mark every point where data is stored or logged. Retention and redaction rules attach to those points in Step 2.
#Find the integrations nobody registered
Self-reported registers miss integrations. Three checks find most of the rest: egress and DNS logs for calls to provider API domains, a scan of repositories and the secrets manager for provider keys, and expense records for AI tools bought on team cards. Each hit becomes a new row or a decommission ticket. The same pattern on employee laptops is shadow AI, which needs endpoint signals as well as network ones.
#Step 2: Write policies as machine-checkable rules
A compliance rule is useful to engineers only when it can be evaluated against one request and return allow, block, redact, or route. Write each rule in the same five-part format, so a reviewer can see what it does and what proves it:
- Scope: which apps, teams, models, or data classes it applies to
- Trigger: what in the request or response activates it
- Action: allow, block, redact, route elsewhere, or require approval
- Owner: the person who approves changes to it
- Evidence: the log field or report that proves it ran
These starter rules fit most LLM applications. Adjust scopes to the register.
| Rule | Action | Evidence |
|---|---|---|
| Only models on the approved list may be called | Block anything else | Request log: model, decision |
| Personal data goes only to models in its residency region | Route or block | Request log: provider, region |
| Emails, phone numbers, and ID formats are removed from prompts for apps that do not need them | Redact | Guardrail result per request |
| Responses are scanned for personal data and secrets | Redact, then log | Guardrail result per response |
| Agents call only tools on their app's allowlist; production writes need approval | Block or hold | Tool-call log, approval record |
| Each team has a monthly spend limit | Block past the limit | Budget counter, rejected requests |
| Every change to a rule, model list, key, or permission is recorded | Log | Signed audit log entry |
Keep the rules in version control next to the configuration that enforces them, so one pull request shows both the policy change and the control change. The AI security policies guide covers the acceptable-use and approval documents that sit around these rules.
#Map each rule to the controls an auditor asks about
Auditors ask about their framework's control IDs, not internal rule names. Give each rule a field listing the control it satisfies in each framework the organization reports against, such as a NIST AI RMF subcategory, an ISO/IEC 42001 control, or an EU AI Act article. One rule often covers several controls; the signed audit log rule, for example, supports change management in all three.
Date the regulatory rows. As of November 23, 2026, the EU AI Act's obligations for stand-alone high-risk systems apply from December 2, 2027, and for high-risk systems embedded in products from August 2, 2028, after the AI Omnibus moved them from August 2026. Article 26 already sets the shape of the evidence: deployers keep the logs a high-risk system generates, to the extent those logs are under their control, for at least six months.
#Step 3: Enforce the rules at one AI gateway
Enforce the rules at one AI gateway that every model request passes through, rather than inside each application. When enforcement lives in application code, each team implements redaction differently, a new app ships without it, and there is no single place to prove it ran.
A gateway sits between applications and providers. Applications send requests to the gateway's base URL, the gateway applies the rules in order, and the request is forwarded, modified, or stopped. Because it sees both directions, it can also check responses and tool calls.
#How Bifrost enforces the starter rules
Bifrost maps onto the starter rules with a small set of verified controls, as of November 23, 2026:
- Identity: each request carries a virtual key. With
enforce_auth_on_inferenceset totrue, a request without a valid key fails with HTTP 401, and an expired or inactive key fails with HTTP 403. - Model allowlist: each provider entry on a key lists
allowed_modelsandblacklisted_models, and a key reaches only the providers it lists unlessallow_all_providersis set. - Budgets and rate limits: budgets apply at the key, team, and customer levels, and a request past a budget returns HTTP 402.
- Guardrails: guardrail rules use CEL expressions that can match on
virtual_key,team,customer, oruser. Built-in options include Gitleaks-backed secrets detection and a custom regex PII template, alongside third-party providers such as Microsoft Presidio, AWS Bedrock Guardrails, and Azure Content Safety. A block returns HTTP 400 withtype: "guardrail_intervention". Rules with themcptarget inspect tool arguments before a tool runs and its result afterward. - Access to the gateway itself: role-based access control covers resources such as guardrail config, virtual keys, and audit logs, so an auditor role can read without changing anything.
One behavior needs a rule of its own. A guardrail provider that returns an error fails open, so the request proceeds. For a rule that must never be skipped, alert on guardrail provider errors and count them in the monthly report, or pair the external provider with a built-in rule that does not depend on a network call.
Redaction has three modes in Bifrost: runtime changes the live payload and the logs, logs_only changes only stored logs and trace exports, and runtime_reversible uses placeholders that can be restored. Pick per rule. Redacting at the gateway, before a prompt reaches the provider, is the only version a team can prove; once a prompt arrives, the provider's terms govern it.
#Close the bypass
A gateway enforces nothing for traffic that goes around it. After apps move onto the gateway:
- revoke provider API keys held by applications and issue gateway keys instead
- keep the remaining provider keys only in the gateway, backed by the secrets manager
- block outbound traffic to provider API domains from everywhere except the gateway's network
- alert on any new key created in a provider console
Deploy the gateway where residency rules require. Bifrost runs as a self-hosted binary and supports in-VPC deployments, on-prem, and air-gapped setups, so prompts are inspected inside the network boundary. The on-prem LLM deployment guide covers the hosting side.
#Step 4: Collect compliance evidence continuously
Evidence is the record that each rule ran on real traffic, and it should come from the control point automatically. A spreadsheet assembled the week before an audit shows what someone could find, not what happened. Two logs at the gateway supply most of it.
The request log records each model call: provider, model, status, tokens, cost, latency, retries, and guardrail results. In Bifrost, built-in observability offers disable_content_logging, which drops request and response content while keeping usage metadata. Turn it on for any app whose rules do not allow storing prompts, because a request log full of raw personal data is a compliance problem of its own.
The audit log records changes to the system itself: who added a model to an allowlist, who raised a budget, who rotated a key, who edited a guardrail. Auditors read it closely, because it shows whether controls stayed in place across the audit period. Bifrost audit logs record every create, update, and delete on the management API with a before-and-after diff (secrets redacted), the acting user, and the request ID. Each entry is signed with HMAC-SHA256, and GET /api/governance/audit-logs/{id}/verify reports whether an entry still matches its signature.
| Requirement | What to check | Bifrost setting |
|---|---|---|
| Tamper evidence | Altering an entry is detectable | HMAC-SHA256 signature per entry, verify endpoint |
| Retention | Matches the longest legal requirement | Audit retention_days; request log_retention_days (default 365) |
| Long-term storage | Archive is write-once | Archive to S3 or GCS with Object Lock, configured on the bucket |
| SIEM export | A format the SIEM reads | JSON, JSON Lines, or Syslog (RFC 5424) |
| Payload storage | Bodies kept where policy allows | Log exports to S3, GCS, or Azure Blob |
| Access to logs | Reading and exporting is permissioned | AuditLogs:Download permission |
Two details catch teams out. Retention in the database does not delete objects already archived to storage, so the bucket needs its own lifecycle rules. And signatures make tampering detectable, not impossible; the write-once guarantee comes from the bucket's Object Lock, which the team configures.
Turn the logs into four recurring reports that answer audit questions directly: blocked requests by rule each month, guardrail detections by app, models in use against the approved list, and every configuration change with its approver.
#Extend the evidence to employee machines
Application traffic is only part of the scope. Bifrost applies its governance and security controls (virtual keys, budgets, guardrails, audit logs) centrally, and Bifrost Edge extends the same controls to AI apps, browser AI, and coding agents on employee machines. Edge security reuses the guardrail profiles already configured at the gateway, so a prompt that breaks a redaction rule is blocked or redacted before it leaves the laptop, and the request lands in the same logs as application traffic.
#A phased rollout with pass conditions
Roll the framework out in five phases, each ending on a pass condition someone can check before the next starts. The durations fit a mid-sized engineering organization with a few dozen LLM integrations; scale them to the register.
#Phase 0: Inventory and ownership (weeks 0 to 3)
Build the register from Step 1, including integrations found through egress and key scans. Assign an owner to every row. Pass: every known model call has a row and a named owner, and every unowned integration has a decommission date.
#Phase 1: Gateway in observe mode (weeks 3 to 6)
Deploy the gateway in the region residency rules require and move the highest-risk apps first: those sending personal or regulated data, and agents with write access to production. Turn on both logs. In Bifrost, an output guardrail with output_mode set to monitor lets responses through untouched and records findings with enforced: false. Monitor mode applies to the output phase only, so for input rules use logs_only redaction or scope the rule by CEL to a test key. Pass: high-risk apps send all traffic through the gateway, and two weeks of logs show what each rule would have blocked.
#Phase 2: Enforce the core rules (weeks 6 to 10)
Use the observe-mode logs to tune guardrails until false positives are rare enough that teams accept blocking. Then switch the model allowlist, personal data redaction, and tool allowlists to enforce, and move the remaining apps. Pass: every register row routes through the gateway, and the core rules block in production.
#Phase 3: Close the bypass (weeks 10 to 12)
Revoke application-held provider keys, restrict egress to provider domains, and turn on alerts for new provider keys. Pass: a test request from an app subnet straight to a provider API fails.
#Phase 4: Evidence and review (week 12 onward)
Connect exports to the SIEM or GRC tool, publish the four reports, and set a quarterly review of the register and rules. Run one internal mock audit: pick three rules, pull their evidence for a random week, and check that an outsider could follow it. Pass: the mock audit passes without anyone building a spreadsheet by hand.
#Where AI compliance frameworks usually break
Most frameworks fail at the seams between steps, not inside one. Check these before the first external audit:
- Rules without evidence fields. A rule that names no log field cannot be proven, however well it runs.
- Fail-open controls nobody watches. A guardrail provider outage that lets requests through is a gap in the audit period unless it was alerted and counted.
- Logs that break the rules they prove. Request logs with raw prompts can hold more personal data than the app itself.
- Bypass paths reopened. A new service with its own provider key quietly leaves the framework. The new-key alert from Phase 3 is the control for it.
- Unversioned changes. A guardrail edited in a console with no linked pull request leaves the audit log as the only record of why.
After Phase 4, a new LLM integration follows one path: add a register row, get a gateway key scoped to approved models, and inherit every rule on its first request. Exceptions go to the rule owner as a pull request. The gateway details in this guide describe Bifrost as of November 23, 2026; recheck the docs before relying on a specific setting, and see the best LLM gateways for how other gateways compare on these controls.
#Questions
What is an AI compliance framework?
An AI compliance framework is the set of processes and controls that turns legal and policy obligations into checks that run on real AI traffic. For LLM applications it has four parts: an inventory of models and data flows, rules written so a machine can evaluate them, one control point that enforces them, and logs that prove the rules ran. Without the last two, it is a policy document.
What are the main AI compliance frameworks?
The three most cited are the NIST AI Risk Management Framework, a voluntary US framework built on four functions (Govern, Map, Measure, Manage); ISO/IEC 42001, a certifiable standard for AI management systems; and the EU AI Act, a regulation with binding obligations. Most organizations build one internal rule set and map each rule to the control IDs of whichever frameworks they report against.
What is the difference between AI governance and AI compliance?
AI governance decides what acceptable AI use looks like in an organization: who approves models, which risks are tolerated, and who owns decisions. AI compliance proves that the AI systems meet specific external and internal requirements, with evidence an auditor can check. Governance sets the rules; compliance shows they held on real traffic during the audit period.
How long should AI request logs be kept for compliance?
Keep them for at least your longest applicable requirement. Under Article 26 of the EU AI Act, deployers of high-risk AI systems keep automatically generated logs under their control for at least six months, unless other Union or national law says otherwise. Sector rules and internal policy often require longer, and data protection law limits how much personal data those logs may hold.
Do you need an AI gateway for AI compliance?
No law requires a gateway, but enforcing rules in every application separately makes compliance hard to prove. A gateway gives one place to check identity, model allowlists, budgets, and guardrails on every request, and one place to write the logs. The framework still needs an inventory, written rules, and network controls that stop applications from calling providers directly.
How long does it take to build an AI compliance framework?
For a mid-sized engineering organization with a few dozen LLM integrations, a working framework takes about twelve weeks: three for inventory, three in observe mode, four to enforce core rules, and two to close the bypass. Evidence collection then runs continuously. Each phase should end on a pass condition someone can check, rather than on a date.