---
title: "AI security policy template for teams using LLMs"
type: "guide"
url: "https://aifordevs.org/articles/ai-security-policies"
markdown: "https://aifordevs.org/articles/ai-security-policies.md"
publisher: "AI for Devs"
license: "https://aifordevs.org/reuse"
attribution: "Credit AI for Devs and link to https://aifordevs.org/articles/ai-security-policies"
description: "A copyable AI security policy template for LLM teams: scope, approved models, data classes, keys, logging, acceptable use, incidents, and review cadence."
author: "AI for Devs"
published: "2026-11-27"
level: "Intermediate"
topics: ["apis", "agents"]
---

# AI security policy template for teams using LLMs

A copyable AI security policy template for LLM teams: scope, approved models, data classes, keys, logging, acceptable use, incidents, and review cadence.

> **TL;DR**
>
> - An AI security policy for a team using LLMs has eight sections: scope, approved models and providers, data classification, keys and secrets, logging and retention, acceptable use, incident response, and review cadence.
> - The template below leaves every number and name as a bracketed placeholder, because retention periods, rotation intervals, and approved models depend on the team's contracts and regulators, and an invented default gets copied without review.
> - Each clause maps to a risk in the OWASP Top 10 for LLM Applications 2026, released August 4, 2026: sensitive information disclosure, excessive agency, supply chain, unbounded consumption, and improper output handling.
> - A gateway enforces five kinds of clause on every request (model allowlist, scoped keys, key expiry, logs, containment), partly enforces four, and leaves scope, model review, code review, notification, and review cadence to people.

An AI security policy for a team using LLMs states which models people and agents may call, what data may go into a prompt, who holds the provider keys, what is logged and for how long, and what happens when something leaks. This article gives a copyable eight-section template with placeholders in place of invented defaults, then sorts its clauses by who enforces them. [Bifrost](https://www.getmaxim.ai), an [open-source AI gateway](https://github.com/maximhq/bifrost), is the worked example for the clauses a gateway can check on every request.

## What an AI security policy covers

An AI security policy covers the risks that appear when every prompt sends data to a third party and every response comes back as untrusted input. A general acceptable use policy does not handle either one. The clauses below are written against named risks, so each can be traced to a reason and dropped if the reason does not apply.

The [OWASP Top 10 for LLM Applications 2026](https://github.com/GenAI-Security-Project/GenAI-LLM-Top10), released August 4, 2026, is the most direct checklist for that mapping. NIST's [Generative AI Profile (AI 600-1)](https://nvlpubs.nist.gov/nistpubs/ai/NIST.AI.600-1.pdf) lists data privacy and information security among the 12 risks it says generative AI creates or makes worse.

| Template section | Main risk it answers | OWASP LLM 2026 entry |
| --- | --- | --- |
| 2. Approved models and providers | Data sent to a model with unknown terms or region | LLM04 Supply Chain |
| 3. Data classification | Customer data or secrets in a prompt, or in output | LLM02 Sensitive Information Disclosure |
| 4. Keys and secrets | A leaked key spends money and reads data under the company account | LLM06 Unbounded Consumption |
| 5. Logging and retention | No record of who sent what to which model | Supports every entry during an investigation |
| 6. Acceptable use | Generated code merged unread; agents acting beyond their task | LLM10 Improper Output Handling, LLM03 Excessive Agency |
| 7. Incident response | Prompt injection or a leak found after the fact | LLM01 Prompt Injection |

Sections 1 and 8 (scope and review cadence) answer no single risk. They decide whether the other six stay true over time. The principles behind these choices are covered in [AI governance principles](https://aifordevs.org/articles/ai-governance-principles), and the mapping to regulations and audit evidence sits in the [AI compliance framework](https://aifordevs.org/articles/ai-compliance-framework) guide.

## How to fill in the template

Replace every bracketed placeholder with a named value, and give each section one owner by role. Placeholders are deliberate: a template that ships with "retain logs for 90 days" gets pasted into a wiki with 90 days intact, whether or not 90 days matches the privacy notice, the provider contract, or the customer agreements.

Three conventions keep the document enforceable:

- **"Must"** marks a rule the team will enforce in a system or audit on a schedule. **"Should"** marks a default that people can depart from with a recorded reason.
- Long lists live in appendices: Appendix A for approved models, Appendix B for data class examples, Appendix C for contacts. Appendices change without re-approving the whole policy.
- Each section is short enough to read during onboarding. A clause nobody checks teaches people to skip the document.

Figure 1 shows where the sections apply along one request when model traffic runs through a gateway.

**Figure 1.** One request checked against the template in the order a gateway runs the checks. A prompt carrying Restricted data stops at the input guardrail and never reaches the provider; an allowed response passes an output check and is logged on the way back.

## Section 1: Scope and ownership

Scope decides which tools, people, and automated systems the policy binds. Name them explicitly. "All AI use" invites the reading that a coding agent in a terminal is a developer tool, not AI use.

```markdown title="ai-security-policy.md"
### 1. Scope and ownership

1.1 This policy applies to [EMPLOYEES, CONTRACTORS, SERVICE ACCOUNTS] that send
    company data to a large language model through a chat app, an API, an IDE
    assistant, a coding agent, an MCP server, or an automated job.
1.2 It covers internal tools, customer-facing features, and scheduled jobs that
    call a model.
1.3 Policy owner: [ROLE]. Technical owner: [ROLE]. Each section names its own
    owner in Appendix C.
1.4 Exceptions require written approval from the policy owner, are recorded in
    [EXCEPTION REGISTER], and expire after [EXCEPTION LIFETIME].
```

Coding assistants and CLI agents belong in scope. They read the repository and send parts of it to a provider, often under a personal account that security has no record of. The [shadow AI](https://aifordevs.org/articles/shadow-ai) guide covers how to find that usage before the policy goes live, so the scope clause describes what people actually run.

## Section 2: Approved models and providers

Only models on the approved list may receive company data, and each entry records the terms that make it approved. Record the model ID as well as the vendor: two models from one provider can differ in region, retention, and whether the enterprise contract covers them.

```markdown title="ai-security-policy.md"
### 2. Approved models and providers

2.1 Teams must call only the models listed in Appendix A.
2.2 Each Appendix A entry records: provider, model ID, hosting region, whether
    the provider may train on submitted data, the provider's retention period,
    and the highest data class the model may receive.
2.3 A new model or provider is reviewed by [REVIEWING ROLES] before first use.
    Target turnaround: [REVIEW TURNAROUND].
2.4 Personal accounts on consumer AI apps must not receive data above Public.
2.5 Self-hosted and open-weight models follow the same review, plus a record of
    where the weights, prompts, and logs are stored.
2.6 MCP servers and agent tools are approved per server in Appendix A, with
    the systems each one can reach.
```

Clause 2.6 matters because an [MCP server](https://aifordevs.org/glossary#mcp-server) is software with the caller's permissions, and OWASP places third-party components under supply chain risk. An unreviewed tool is an unreviewed dependency.

## Section 3: Data classification for prompts and outputs

Each data class gets a plain rule about which models may see it. "Be careful with sensitive data" is not a rule anyone can follow at the keyboard. Most companies already have classes for documents; reuse their names so engineers do not learn a second scheme.

```markdown title="ai-security-policy.md"
### 3. Data classification

3.1 Public: published docs, marketing copy, open-source code.
    Any Appendix A model.
3.2 Internal: internal docs, non-customer code, architecture notes.
    Appendix A models with a no-training agreement.
3.3 Confidential: customer data, contracts, financials, unreleased plans.
    Only models marked Confidential in Appendix A, and only through
    [APPROVED PATH, e.g. THE COMPANY GATEWAY OR ENTERPRISE ACCOUNT].
3.4 Restricted: credentials, payment card data, health records, government IDs.
    Must not be sent to any model unless [NAMED REDACTION SYSTEM] removes it first.
3.5 Model output inherits the highest class of the input that produced it.
3.6 Appendix B lists two or three examples of each class from company systems.
```

Clause 3.6 does more work than it looks. Engineers classify faster from "the orders table" than from a definition. Clause 3.5 closes a common gap: a summary of a Confidential contract is still Confidential, even though no single sentence of it was copied.

## Section 4: API keys and secrets

Provider keys are bearer tokens with spend attached, so they live in a secrets manager and in one central service, never in code, laptops, or shared documents. People and applications get scoped credentials instead of the raw provider key.

```markdown title="ai-security-policy.md"
### 4. Keys and secrets

4.1 Provider API keys must be stored in [SECRETS MANAGER] and must not appear in
    source code, shell profiles, CI variables, or shared documents.
4.2 People and services receive scoped credentials, one per [PERSON, TEAM, OR
    SERVICE], instead of a provider key.
4.3 Each scoped credential carries a spend limit and a rate limit set by the
    technical owner.
4.4 Credentials are rotated every [ROTATION INTERVAL] and revoked within
    [REVOCATION WINDOW] of a suspected leak or a departure.
4.5 Secret scanning runs on every repository and blocks commits that contain
    provider keys.
4.6 Prompts must not contain credentials. Tool output that contains secrets is
    redacted before it returns to the model.
```

Scoped credentials pay for themselves first. When one team's credential leaks, the technical owner revokes that one, and every other team keeps working. Clause 4.3 is also the policy's answer to OWASP's unbounded consumption entry: a leaked credential with a budget has a ceiling.

## Section 5: Logging and retention

Log enough to answer "who sent what to which model, and what came back" during an investigation, then delete on a schedule. Metadata and content are separate decisions: metadata is cheap and rarely sensitive, while prompt bodies are often the most sensitive data in the system.

```markdown title="ai-security-policy.md"
### 5. Logging and retention

5.1 Every model call logs: timestamp, user or service identity, credential ID,
    provider, model, token counts, cost, latency, and status.
5.2 Prompt and response bodies are logged for [ALL / SAMPLED / NO] traffic, and
    are redacted or not stored for Confidential and Restricted classes.
5.3 Logs are stored in [SYSTEM] with read access limited to [ROLES].
5.4 Metadata is retained for [METADATA RETENTION]. Bodies are retained for
    [BODY RETENTION] unless an incident hold applies.
5.5 Changes to this policy's controls (credentials created, permissions changed,
    guardrails edited) are recorded in a tamper-evident audit log retained for
    [AUDIT LOG RETENTION].
```

The retention values must match the privacy notice and customer contracts. Set them with legal, then write the result here. Clause 5.5 is separate from 5.1 on purpose: request logs answer what users did, and the audit log answers what administrators changed.

## Section 6: Acceptable use and agents

Acceptable use lists what people may and may not do with model output, with the review step tied to the risk of the task. Agents get their own clauses, because an [agent](https://aifordevs.org/articles/what-is-an-ai-agent) with [tool calling](https://aifordevs.org/glossary#tool-calling) can act before a person reads anything.

```markdown title="ai-security-policy.md"
### 6. Acceptable use

6.1 Generated code is reviewed by a person before merge, under the same rules as
    human-written code.
6.2 Model output is not sent to customers, regulators, or the public without
    human review, unless the feature passed [PRODUCT SECURITY REVIEW].
6.3 Agents act on production systems only with credentials scoped to the task,
    and a person approves [LIST OF DESTRUCTIVE ACTIONS] before they run.
6.4 Models do not make final decisions on [HIRING, CREDIT, MEDICAL, OTHER
    REGULATED DECISIONS].
6.5 Users do not attempt to bypass guardrails, filters, or the approved path.
6.6 Suspected prompt injection, data leakage, or harmful output is reported to
    [REPORTING CHANNEL].
```

Clause 6.3 is the policy's answer to excessive agency, which OWASP moved to third place in the 2026 list. Clause 6.1 answers improper output handling: generated SQL or shell commands are untrusted input until reviewed.

## Section 7: Incident response

An AI incident follows the existing incident process, with LLM-specific triggers and first steps added. Do not write a parallel process; responders under pressure follow the one they know.

```markdown title="ai-security-policy.md"
### 7. Incident response

7.1 Triggers: a provider key or scoped credential exposed; Confidential or
    Restricted data sent to a model not approved for it; an agent taking an
    unapproved action; harmful output reaching a customer.
7.2 First responder: [ON-CALL ROLE], reached through [PAGER OR CHANNEL].
7.3 Immediately: disable or rotate the affected credentials, block the affected
    model or route on the approved path, and place relevant logs under hold.
7.4 Within [INVESTIGATION WINDOW]: identify affected data and users, and ask the
    provider to delete submitted data where the contract allows.
7.5 Notify customers and regulators under [EXISTING BREACH NOTIFICATION POLICY].
7.6 Post-incident review within [REVIEW DEADLINE], with control changes tracked
    to closure.
```

Run one tabletop exercise with a leaked credential before it is needed. It shows whether anyone on call can disable a key inside the revocation window from clause 4.4, and whether the logs from Section 5 name the user who sent the data.

## Section 8: Review cadence and exceptions

Review the policy on a fixed schedule and on trigger events. The approved model list goes stale faster than any other part, so it gets its own, shorter interval.

```markdown title="ai-security-policy.md"
### 8. Review cadence and exceptions

8.1 The policy owner reviews the full policy every [POLICY REVIEW INTERVAL].
8.2 The technical owner reviews Appendix A every [MODEL LIST REVIEW INTERVAL].
8.3 Out-of-cycle review is triggered by a new provider contract, a model the
    team wants to adopt before the next review, a security incident, or a
    change in applicable regulation.
8.4 Exceptions are logged in [EXCEPTION REGISTER] with owner, reason,
    compensating controls, and expiry date.
8.5 Each review records what changed and who approved it.
```

Expired exceptions are the usual way a policy decays. Clause 8.4's expiry date turns the register into a list someone must act on, not a record that grows.

## Which clauses a gateway enforces

A gateway enforces the clauses that can be checked on a request, partly enforces the ones that need pattern matching, and leaves judgment to people. An [AI gateway](https://aifordevs.org/glossary#ai-gateway) sits between callers and providers, so it sees every request that is routed to it and can reject, redact, or log it before anything leaves. Figure 2 sorts the template's clauses.

**Figure 2.** About half the template can run as gateway configuration. Data rules are only partly enforceable, because a pattern catches a key or a card number but cannot tell an internal document from a public one, and scope, model review, and notification stay with people.

The split holds for any gateway. Before choosing one, map Sections 2, 4, and 5 onto its configuration line by line. A clause that cannot be mapped stays on paper.

### Bifrost as the enforcement layer

[Bifrost](https://www.getmaxim.ai) is one gateway where each enforceable clause maps to a setting, as of November 23, 2026. It is an AI gateway and control plane for model, MCP tool, and agent traffic, with an OpenAI-compatible API. Several of the controls below are part of Bifrost Enterprise.

| Template clause | Bifrost control | Tier |
| --- | --- | --- |
| 2.1 Approved models only | Virtual keys are deny-by-default for providers, with per-provider `allowed_models` | Open source |
| 2.6 Approved MCP tools | A virtual key with no MCP configuration gets no MCP tools | Open source |
| 4.1 Keys in a secrets manager | Provider keys resolved from AWS Secrets Manager, GCP Secret Manager, HashiCorp Vault, or Azure Key Vault | Enterprise |
| 4.2, 4.3 Scoped credentials with limits | Virtual keys per team or customer (per user on Enterprise), with budgets and token and request rate limits | Open source |
| 4.4 Rotation and revocation | Key expiry, an active toggle, and scheduled rotation through access profiles | Expiry: open source; rotation: Enterprise |
| 3.4, 4.6 Restricted data in prompts | Secrets detection and PII guardrails on input and output | Enterprise |
| 5.1, 5.2 Request logs, content off | Logs with identity, model, tokens, cost, and latency; content logging switchable per key | Open source |
| 5.5 Audit log | HMAC-signed audit events with configurable retention | Enterprise |

[Virtual keys](https://docs.getbifrost.ai/features/governance/virtual-keys) carry clauses 2.1 and 4.2 to 4.4. A key can use only the providers listed on it, an empty list blocks every provider, and each provider entry can restrict models. Each key holds its own budgets and rate limits, an expired key is rejected with a `403`, and a key can be switched off at once for clause 7.3. [MCP tool filtering](https://docs.getbifrost.ai/features/governance/mcp-tools) applies the same deny-by-default rule to agent tools, except for MCP clients an admin marks Allow by Default.

On Enterprise, [access profiles](https://docs.getbifrost.ai/enterprise/access-profiles) rotate the virtual keys owned by users on a schedule of 7, 30, or 90 days or a custom interval. Keys owned by teams, business units, and customers are not rotated automatically, so clause 4.4 still needs a manual step for service credentials. [Secret management](https://docs.getbifrost.ai/enterprise/secret-management) stores a reference to the provider key, not the key, which satisfies clause 4.1. With [user provisioning](https://docs.getbifrost.ai/enterprise/user-provisioning), credentials come from the identity provider, so a departure in clause 4.4 is handled by the directory.

[Guardrails](https://docs.getbifrost.ai/enterprise/guardrails) are the partial-enforcement column. They run on LLM inputs and outputs and on MCP tool arguments and results. [Secrets detection](https://docs.getbifrost.ai/enterprise/guardrails/secrets-detection) is Gitleaks-backed and can detect, block (the default), or redact, and the [PII detection template](https://docs.getbifrost.ai/enterprise/guardrails/custom-regex) covers emails, phone numbers, and card-like numbers. Neither can read a contract and decide it is Confidential, which is why Section 3 stays partly manual. The [guardrails overview](https://www.getmaxim.ai/resources/guardrails) lists the external providers that plug in alongside them.

For Section 5, [content logging](https://docs.getbifrost.ai/features/observability/content-logging) can be turned off per client or virtual key, and per project on Enterprise. Setting it only on the client still exports full content to configured connectors, so clause 5.2 needs the flag on every connector too. [Audit logs](https://docs.getbifrost.ai/enterprise/audit-logs) cover clause 5.5 with signed events, a `retention_days` setting, and export as JSON, JSON Lines, or Syslog. The [governance overview](https://www.getmaxim.ai/resources/governance) shows how keys, budgets, and profiles fit together.

A gateway governs only the traffic sent to it. [Bifrost Edge](https://www.getmaxim.ai/edge) extends the same governance and security to employee machines, routing AI traffic from desktop apps, browser AI, and coding agents through the gateway, where the [guardrails already configured apply](https://docs.getbifrost.ai/edge/security) with no setup on the endpoint. That brings clause 2.4 (no personal accounts for company data) and clause 1.1's coding agents under the same checks as API traffic. The [Edge overview](https://docs.getbifrost.ai/edge/overview) lists the supported apps.

### Roll the policy out in enforcement order

Publish the clauses a system can check before the ones people must follow, so the first version is true on day one.

1. Inventory current usage with the [shadow AI](https://aifordevs.org/articles/shadow-ai) signals, and write Appendix A from what teams already run.
2. Move provider keys into the secrets manager and issue scoped credentials with budgets (Section 4).
3. Turn on request logging with content rules for Confidential and Restricted traffic (Section 5).
4. Add input guardrails for secrets and PII in detect mode, review the hits for two weeks, then switch to block or redact (Section 3).
5. Publish Sections 1, 6, 7, and 8, and schedule the first tabletop exercise.

Fill every placeholder before step 5. A published policy with `[ROTATION INTERVAL]` still in it tells readers the clause is optional.

## Questions

### What is an AI security policy?

An AI security policy is the written rule set for how a company's people, apps, and agents use AI models. For a team using LLMs it names the approved models and providers, which data classes may go into a prompt, who holds the API keys, what is logged and for how long, what output needs human review, and who responds when data or a key leaks.

### What should an AI security policy include?

At minimum: scope and owners, an approved model and provider list, data classification rules for prompts and outputs, key and secret handling, logging and retention, acceptable use including agent permissions, incident response triggers and first steps, and a review cadence with an exception register. Each clause should name an owner and a value, not a general intention.

### What is the difference between an AI security policy and an AI acceptable use policy?

An acceptable use policy tells people what they may do with AI tools. A security policy also covers the systems: which providers are approved, how keys are stored and rotated, what gets logged, how long records are kept, and how an incident is contained. Acceptable use is usually one section of the security policy, as it is in this template.

### How often should an AI security policy be reviewed?

Review the full policy on a fixed interval the policy owner sets, and review the approved model list more often, because providers release and retire models faster than anything else in the document changes. Trigger an out-of-cycle review on a new provider contract, a security incident, a change in applicable regulation, or a model the team wants to adopt before the next scheduled review.

### Can an AI gateway enforce an AI security policy?

A gateway enforces the clauses that can be checked on a request: the model allowlist, scoped keys with budgets and rate limits, key expiry, request logging, and containment by disabling a key. It partly enforces data rules through pattern-based guardrails. Scope, model review, code review, breach notification, and the review cadence stay with people.

### Should a company allow personal AI accounts for work?

Most policies should not let company data above the Public class reach a personal account, because consumer plans carry consumer data terms and leave no company record. A ban works only when an approved option is at least as good. Otherwise usage moves to unmanaged tools, which is the shadow AI problem the policy was meant to prevent.

## Sources

1. [OWASP GenAI Security Project, Top 10 for LLM Applications 2026 (released August 4, 2026; read November 23, 2026)](https://github.com/GenAI-Security-Project/GenAI-LLM-Top10)
2. [NIST, AI 600-1: Artificial Intelligence Risk Management Framework, Generative AI Profile (July 2024; read November 23, 2026)](https://nvlpubs.nist.gov/nistpubs/ai/NIST.AI.600-1.pdf)
3. [Bifrost reference for AI systems (llm-info, last updated September 2026; read November 23, 2026)](https://www.getmaxim.ai/llm-info)
4. [Bifrost docs, Virtual keys (read November 23, 2026)](https://docs.getbifrost.ai/features/governance/virtual-keys)
5. [Bifrost docs, Access profiles (read November 23, 2026)](https://docs.getbifrost.ai/enterprise/access-profiles)
6. [Bifrost docs, Secret management (read November 23, 2026)](https://docs.getbifrost.ai/enterprise/secret-management)
7. [Bifrost docs, Guardrails (read November 23, 2026)](https://docs.getbifrost.ai/enterprise/guardrails)
8. [Bifrost docs, Secrets detection guardrail (read November 23, 2026)](https://docs.getbifrost.ai/enterprise/guardrails/secrets-detection)
9. [Bifrost docs, Custom regex guardrails and PII detection template (read November 23, 2026)](https://docs.getbifrost.ai/enterprise/guardrails/custom-regex)
10. [Bifrost docs, Guardrail redaction modes (read November 23, 2026)](https://docs.getbifrost.ai/enterprise/guardrails/redaction)
11. [Bifrost docs, Content logging (read November 23, 2026)](https://docs.getbifrost.ai/features/observability/content-logging)
12. [Bifrost docs, Built-in observability (read November 23, 2026)](https://docs.getbifrost.ai/features/observability/default)
13. [Bifrost docs, Audit logs (read November 23, 2026)](https://docs.getbifrost.ai/enterprise/audit-logs)
14. [Bifrost docs, MCP tool filtering (read November 23, 2026)](https://docs.getbifrost.ai/features/governance/mcp-tools)
15. [Bifrost docs, User provisioning (read November 23, 2026)](https://docs.getbifrost.ai/enterprise/user-provisioning)
16. [Bifrost docs, Edge security and guardrails (read November 23, 2026)](https://docs.getbifrost.ai/edge/security)
17. [Bifrost docs, Bifrost Edge overview (read November 23, 2026)](https://docs.getbifrost.ai/edge/overview)

## Cite this guide

AI for Devs. "AI security policy template for teams using LLMs." Published November 27, 2026. https://aifordevs.org/articles/ai-security-policies

- Page: https://aifordevs.org/articles/ai-security-policies
- Markdown: https://aifordevs.org/articles/ai-security-policies.md
- Reuse: Quote or summarize with a link to this page. Terms: https://aifordevs.org/reuse
- Publisher: AI for Devs
- Published: 2026-11-27
