Markdown Editor

Guardrails and Safety Filter Specification Template (OWASP LLM Top 10 2026)

Policy taxonomy, input, output and tool-call guards, thresholds and actions, false-positive and latency budgets, guard evaluation, OWASP LLM 2026 mapping

KI & DatenVollständigOWASP Top 10 for LLM Applications 2026; OWASP Top 10 for Agentic Applications 2026CC BY-SA 4.0guardrailsspecmath

Anleitung: Use it when you add or change safety filters, injection detectors or tool-call rules around an LLM application or agent. Fill the policy taxonomy first, then each guard's threshold, action and budgets from evaluation data. The main pitfall is treating a classifier as the only control in front of a tool or data store.

Vorschau

Guardrails and Safety Filter Specification: [Application name] [version]

Specification of the guardrails around an LLM application or agent: the policy taxonomy, input guards (prompt injection, jailbreak, personal data), output guards (toxicity, grounding, data leakage, format), tool-call guards, thresholds and actions (block, redact, warn, escalate), false-positive and latency budgets, evaluation of the guards themselves, monitoring and change management. Each guard is mapped to the OWASP Top 10 for LLM Applications 2026 (LLM01:2026 to LLM10:2026) and, for agents, to the OWASP Top 10 for Agentic Applications 2026. Replace every [bracketed] value and every row marked Example. Worked examples use a customer support assistant for an online bank that answers questions from help articles and can look up a customer's own transactions.

Document control

FieldValue
Document ID[GRD-2026-001]
Version[0.1]
Status[Draft / In review / Approved / Superseded]
Owner[@safety-engineer]
Approvers / reviewers[@app-owner], [@security-lead], [@privacy-officer], [@trust-and-safety]
Last updatedYYYY-MM-DD
Classification[Confidential; thresholds help attackers]
Application[Name], [version or commit]
Guard bundle version[guards-vN], deployed as [identifier]
Model(s) guarded[Provider, model, snapshot date]
Frameworks usedOWASP Top 10 for LLM Applications 2026; OWASP Top 10 for Agentic Applications 2026
Related documents[Prompt specification], [Agentic threat model], [Red team report]

Approvals

RoleNameDecisionDate
Application owner[@name][Approved / Approved with conditions / Rejected]YYYY-MM-DD
Security lead[@name][Decision]YYYY-MM-DD
Privacy officer[@name][Decision]YYYY-MM-DD
Trust and safety lead[@name][Decision]YYYY-MM-DD

Revision history

VersionDateAuthorChange summary
0.1YYYY-MM-DD[@name]First draft
0.2YYYY-MM-DD[@name]Example: Lowered injection threshold after red team finding RT-F-002
1.0YYYY-MM-DD[@name]Example: Approved for production with guards-v3

Contents

1. Scope and architecture

1.1 Application summary

[Application name] answers [customer questions about cards, transfers and fees] using [retrieved help articles] and can call [get_transactions for the signed-in customer only]. It serves [about 200,000 conversations per month] in [web and mobile chat] in [languages].

1.2 Guard placement

The diagram shows every point where a guard inspects content or an action. Retrieved text and tool results pass the context guards before they reach the model.

1.3 Guard inventory

IDGuardStageMechanismVersionOwner
GRD-IN-001 (Example)Prompt injection detectorInput and contextFine-tuned classifier[v4][@safety-engineer]
GRD-IN-002 (Example)Jailbreak detectorInputClassifier plus pattern list[v2][@safety-engineer]
GRD-IN-003 (Example)Personal data detectorInputNamed entity model plus regular expressions for IBAN and card numbers[v5][@privacy-eng]
GRD-IN-004 (Example)Topic scopeInputEmbedding similarity to allowed topics[v1][@product]
GRD-OUT-001 (Example)Toxicity and harassmentOutputModeration model[v3][@trust-and-safety]
GRD-OUT-002 (Example)Grounding checkOutputClaim-to-source entailment model[v2][@ml-engineer]
GRD-OUT-003 (Example)Data leakageOutputPersonal data detector plus hidden-context canary match[v5][@privacy-eng]
GRD-OUT-004 (Example)Format and renderingOutputSchema validation, Markdown sanitiser, link allowlist[v2][@app-engineer]
GRD-TOOL-001 (Example)Tool allowlist and argument validationTool callDeterministic policy engine enforcing TGR-001 to TGR-003 and TGR-005[v3][@platform-engineer]
GRD-TOOL-002 (Example)Tool-call rate and loop limitTool callCounter per session enforcing TGR-004[v1][@platform-engineer]
[GRD-XX-NNN][Guard][Stage][Mechanism][vN][@owner]

2. Policy taxonomy

IDCategoryIncludesExcludesDefault actionSeverity
POL-01 (Example)Prompt injectionInstructions to ignore rules, role overrides, hidden instructions in documentsQuestions about how the assistant worksBlockHigh
POL-02 (Example)Jailbreak attemptRole play or encoding meant to bypass safety behaviourFiction requests without policy impactBlockHigh
POL-03 (Example)Personal data from the userCard numbers, IBANs, government IDs typed into chatCustomer's own first nameRedact before logging and model callMedium
POL-04 (Example)Personal data of othersData about a person who is not the signed-in customerPublic company namesBlock in outputHigh
POL-05 (Example)Harassment and hateAbuse aimed at people or groupsCustomer quoting abuse they received, for a complaintWarn and de-escalateMedium
POL-06 (Example)Self-harm signalsStatements of intent or crisisDiscussion of insurance termsEscalate to human with support resourcesCritical
POL-07 (Example)Ungrounded financial statementsFees, rates or rules not supported by retrieved articlesGeneral greetingsBlock and regenerateHigh
POL-08 (Example)Hidden context exposureSystem prompt, internal rules, tool schemasPublic help article textBlockMedium
POL-09 (Example)Out of scopeInvestment advice, legal advice, unrelated topicsQuestions about bank productsRedirectLow
POL-10 (Example)Unsafe renderingScripts, external images, links outside the allowlistLinks to the bank's help centreStripHigh
[POL-NN][Category][Includes][Excludes][Action][Severity]

Labelling guide: [link to the annotation guidelines with at least five positive and five negative examples per category].

3. Input guards

3.1 Prompt injection and jailbreak

ItemGRD-IN-001 Prompt injectionGRD-IN-002 Jailbreak
InspectsUser message, retrieved chunks, tool resultsUser message and last [3] turns
PolicyPOL-01POL-02
DecisionScore 0 to 1; threshold in section 6Score 0 to 1 plus pattern list
On hit (user message)Block, fallback reply, logBlock, fallback reply, log
On hit (retrieved chunk)Drop chunk, mark source for reviewn/a
Known limitsNovel phrasings and other languages; see evaluation in section 8Multi-turn escalation

Design rules:

  • Mark untrusted content (retrieved text, tool results) as data in the prompt and never let it change tool selection on its own.
  • Do not rely on the injection detector to protect tools; tool-call guards in section 5 enforce permissions independently.
  • Normalise input before scoring: decode common encodings, remove zero-width characters, and score each language the product supports.

3.2 Personal data in input

GRD-IN-003 detects [card numbers (with Luhn check), IBANs, national ID formats for supported countries, email addresses and phone numbers]. Detected values are replaced with typed placeholders such as [CARD_1] before the text is logged or sent to the model, and the mapping is kept only in memory for the session so the tool layer can use it where the task needs it.

3.3 Topic scope

GRD-IN-004 compares the message with the allowed topic set. Below the similarity threshold the assistant replies with a scoped redirect rather than a refusal, and the message is not sent to the model.

4. Output guards

GuardChecksPolicyOn hitRegenerations
GRD-OUT-001 (Example)Toxic, harassing or hateful languagePOL-05Block and regenerate with stricter instruction1, then fallback
GRD-OUT-002 (Example)Each factual claim about fees, limits or rules is entailed by a retrieved sourcePOL-07Remove unsupported claim or regenerate; cite sources1, then "I could not confirm this" reply
GRD-OUT-003 (Example)Personal data of anyone other than the signed-in customer; canary strings from hidden contextPOL-04, POL-08Block and log as security event0
GRD-OUT-004 (Example)JSON schema for structured replies; Markdown sanitised; links on allowlist; no external imagesPOL-10Strip unsafe parts; on schema failure regenerate2
[GRD-OUT-NNN][Checks][POL-NN][Action][n]

Notes:

  • Streaming: when answers stream to the user, run fast guards on each chunk and hold the final [N] tokens until the slower guards pass, or disable streaming for high-risk intents.
  • Grounding: a grounding guard needs the retrieved sources as input; log the source IDs with the decision so reviewers can check it.
  • Rendering: output encoding and sanitisation happen in the client or renderer as well, because the guard can be bypassed by a bug elsewhere.

5. Tool-call guards

Rule IDToolRuleEnforcement pointOn violation
TGR-001 (Example)get_transactionscustomer_id must equal the session's customer; model-supplied IDs are ignoredTool gatewayReject, log security event
TGR-002 (Example)get_transactionsDate range at most [90] days; page size at most [50]Tool gatewayClamp and log
TGR-003 (Example)AnyOnly tools on the allowlist for this intent may be calledOrchestratorReject
TGR-004 (Example)AnyAt most [5] tool calls per turn and [20] per sessionOrchestratorStop, fallback reply
TGR-005 (Example)create_dispute (if enabled)Requires explicit customer confirmation shown by the client, not by the modelClient and gatewayHold until confirmed
[TGR-NNN][Tool][Rule][Point][Action]

Agent deployments: align these rules with the [Agent tool permission design] and the OWASP agentic categories ASI02 (Tool Misuse and Exploitation) and ASI03 (Identity and Privilege Abuse).

6. Thresholds and actions

6.1 Actions

ActionMeaningUser seesLogged as
AllowPass throughNormal answerDecision only
RedactReplace the matched span with a placeholderAnswer with placeholderDecision and span type
WarnAllow but append a notice or softenAnswer with noticeDecision and score
BlockDo not send; use fallbackFallback replyDecision, score, excerpt reference
EscalateHand to a human or a support flowHandoff messageDecision and case ID

6.2 Threshold table

GuardScore rangeAllow belowWarnBlock at or aboveEscalateBasis
GRD-IN-001 (Example)0 to 10.500.50 to 0.80 (context chunks: drop)0.80n/aSection 8 evaluation, run EV-12
GRD-IN-002 (Example)0 to 10.60n/a0.60n/aSection 8, run EV-12
GRD-OUT-001 (Example)0 to 10.400.40 to 0.700.70n/aModeration vendor guidance plus own test set
GRD-OUT-002 (Example)Entailment 0 to 1n/an/aBelow 0.60n/aCalibration set GS-03
POL-06 detector (Example)0 to 10.30n/an/a0.30Low threshold by design: false negatives are costly
[Guard][Range][Value][Range][Value][Value][Evidence]

Where a threshold is used per language or per channel, list each row separately.

7. False-positive and latency budgets

7.1 False-positive budget

The false-positive rate (FPR) and the false-negative rate (FNR) of a guard on a labelled set are:

FPR=FPFP+TNFNR=FNFN+TP\text{FPR} = \frac{FP}{FP + TN} \qquad \text{FNR} = \frac{FN}{FN + TP}
GuardMax FPR on benign trafficMax FNR on attack or policy setMeasured on
GRD-IN-001 (Example)[1.0%][10%]Benign set BN-01 (5,000), attack set AT-01 (1,200)
GRD-IN-003 (Example)[0.5%][2%]PII set PII-02
GRD-OUT-002 (Example)[3%][8%]Grounding set GS-03
Combined, all guards (Example)[2.5%] of conversations with any blockn/aProduction sample
[Guard][Value][Value][Set]

7.2 Latency budget

StageGuard(s)p50 budgetp95 budgetMode
Input (Example)GRD-IN-001 to GRD-IN-004[40 ms][120 ms]Parallel
Context (Example)GRD-IN-001 on chunks[30 ms][90 ms]Batched
Output (Example)GRD-OUT-001 to GRD-OUT-004[150 ms][400 ms]Parallel, before release of final tokens
Tool call (Example)TGR rules[5 ms][20 ms]Inline
Total added (Example)All[250 ms][600 ms]n/a
[Stage][Guards][Value][Value][Mode]

Failure mode: if a guard times out or errors, [fail closed for GRD-OUT-003 and TGR rules; fail open with logging for GRD-IN-004]. Record the choice per guard.

8. Evaluation of guards

SetPurposeSizeSourceRefresh
BN-01 (Example)Benign production-like traffic5,000Sampled, anonymised conversationsQuarterly
AT-01 (Example)Injection and jailbreak attacks1,200Red team library, public benchmarks, new findingsMonthly
PII-02 (Example)Personal data detection2,000Synthetic generator plus real formatsQuarterly
GS-03 (Example)Grounded and ungrounded answers800Human-labelledQuarterly
ML-01 (Example)Multilingual variants of AT-011,200Translated and native-writtenQuarterly
[Set][Purpose][n][Source][Cadence]

Report for each guard: precision, recall, FPR and FNR with 95% intervals, broken down by language and channel; the confusion matrix; and the 20 most frequent false positives with a fix proposal. Feed red team findings into AT-01 within [one week]. Keep a private hold-out portion of each attack set so guard tuning does not overfit.

Adaptive attacks: guards are tested by people who know the guard exists. Include cases crafted to evade the specific guard (encodings, splitting across turns, payloads in retrieved documents) and report them separately from static benchmark results.

9. OWASP mapping

The IDs and short names below follow the OWASP Top 10 for LLM Applications 2026 (published August 2026). Check the current list at https://genai.owasp.org/ before review.

OWASP 2026 IDRiskGuardsOther controls (outside this document)
LLM01:2026Prompt InjectionGRD-IN-001, GRD-IN-002, TGR-003Data marking in prompts, least-privilege tools
LLM02:2026Sensitive Information DisclosureGRD-IN-003, GRD-OUT-003, TGR-001Access control in retrieval and tools
LLM03:2026Excessive AgencyTGR-001 to TGR-005Agent tool permission design
LLM04:2026Supply ChainNoneModel and package provenance, AI bill of materials
LLM05:2026Data and Model PoisoningGRD-IN-001 on retrieved chunks (partial)Content ingestion review, index provenance
LLM06:2026Unbounded ConsumptionTGR-004, input length limitRate limiting, cost budgets
LLM07:2026MisinformationGRD-OUT-002Retrieval quality, evaluation plan
LLM08:2026Hidden Context ExposureGRD-OUT-003 canary matchKeep secrets and authorisation out of prompts
LLM09:2026Vector and Embedding WeaknessesNoneTenant filters in the vector store
LLM10:2026Improper Output HandlingGRD-OUT-004Output encoding in the client

For agents, also map to the OWASP Top 10 for Agentic Applications 2026:

ASI IDCategoryGuards
ASI01Agent Goal HijackGRD-IN-001 on all untrusted inputs, TGR-003
ASI02Tool Misuse and ExploitationTGR-001 to TGR-005
ASI03Identity and Privilege AbuseTGR-001
ASI06Memory & Context PoisoningGRD-IN-001 on memory writes and recalls
ASI09Human-Agent Trust ExploitationGRD-OUT-002 grounding with visible sources
[ASInn][Category][Guards]

10. Monitoring and response

SignalThreshold for alertReceiverResponse
Example: Block rate per guardChange of more than [50%] week on week[@safety-engineer]Check for attack wave or false-positive regression
Example: GRD-OUT-003 hitsAny[@security-on-call]Treat as possible data leak; open incident
Example: TGR-001 rejectionsMore than [10] per hour[@security-on-call]Investigate targeted abuse
Example: Guard p95 latencyAbove budget for [15 minutes][@platform-on-call]Scale or fail over
Example: User appeals of blocksMore than [20] per week[@product]Review false positives
[Signal][Threshold][Receiver][Response]

Logging: record guard ID, version, score, decision and a reference to the content in an access-controlled store; do not copy raw personal data into general logs. Retain guard logs for [90 days].

Serious events (data leak, self-harm escalation failure, tool rule bypass) follow the [AI incident report] process.

11. Change management

Change typeEvidence requiredApproverRollout
Threshold changeBefore and after FPR and FNR on all setsGuard owner and security leadCanary [10%] for [48 h]
New guard model versionFull section 8 evaluation, latency testGuard owner, security lead, trust and safetyShadow mode, then canary
New policy categoryLabelling guide, test set, legal or policy sign-offApplication owner, trust and safetyShadow mode first
Pattern list updateRegression on BN-01 and AT-01Guard ownerDirect, with rollback
Emergency block ruleIncident ticketSecurity on-callImmediate; review within [5] working days

Keep every guard version, threshold and pattern list in version control with the change reason. Rollback must be possible within [15 minutes].

12. Glossary and references

TermMeaning
GuardrailA control that checks or constrains model inputs, outputs or actions against a policy
Fail closedWhen a guard errors, block the request
Fail openWhen a guard errors, let the request continue and log it
GroundingWhether a claim is supported by the provided sources
Canary stringA unique marker placed in hidden context so that its appearance in output reveals a leak
False positiveA benign request the guard wrongly blocks or changes
Adaptive attackAn attack designed with knowledge of the specific guard

References:

Standard and licence note

Based on the OWASP Top 10 for LLM Applications 2026 and the OWASP Top 10 for Agentic Applications for 2026 by the OWASP GenAI Security Project (https://genai.owasp.org/), licensed under Creative Commons Attribution-ShareAlike 4.0 (https://creativecommons.org/licenses/by-sa/4.0/), and on NIST AI 100-2 E2025 (a NIST publication). The OWASP IDs and short names are used for mapping; all descriptions, policies, thresholds and examples are original text, and example values are illustrative rather than recommended settings. Because the mapping tables adapt the OWASP structure, that adapted structure is shared under CC BY-SA 4.0 and any further adaptation must carry the same licence. Check the current official versions of the OWASP lists before use. Apart from the adapted OWASP structure, the original text is under the template licence. Template licence: MIT.

Ähnliche Vorlagen