StrategyCore
Back to Resources
32/ai / ml 2 min read

LLM guardrails: test inputs, outputs and tool permissions

Keep sensitive records and privileged actions protected even when a model follows a hostile instruction.

A retrieved document can contain instructions that the application never intended to execute. An output filter may miss a credential or block a legitimate answer. Design the application around these possible failures: restrict the records it can retrieve, validate tool calls and measure what the filters miss.

Separate content checks from permissions

SC-BD-06 · REV A · 2026.07

Application controls
Request handling

Input checks and retrieval

content rules and document access

Model and output checks

generation and validation

Tool executor

caller and action permissions

Authorised input
Prohibited output handling
Tool authorisation
Untrusted content

Prompts and documents

direct or indirect instructions

Illustrative controls. Filters can fail and must be tested.

Input and output checks surround model use; retrieval and tools enforce their own access rules.
01

Treat retrieved instructions as untrusted content

Prompt injection can be direct, through a user request, or indirect, through a document, web page or other material. Jailbreaking seeks to bypass safety restrictions; it is not simply another name for every direct prompt injection. Separate external content from application instructions, limit its influence and test attacks in the languages and formats the application accepts. RAG and a strong system prompt do not eliminate this risk.

02

Check document permissions before retrieval

Do not retrieve records a user is not authorised to read and rely on the model to hide them. Enforce document and tenant permissions in the retrieval path. Test a request for another customer’s invoice, a document whose access was revoked and an answer assembled from multiple sources. Output screening is an additional check, not permission enforcement.

03

Validate outputs for the intended use

Define prohibited disclosures and invalid formats, then decide whether a match causes redaction, refusal or referral to a person. A filter that detects a pattern resembling a secret cannot prove that all secrets have been found. Check factual support separately from format and sensitive-content rules. An apparently safe answer can still contain an incorrect number or an invented citation.

04

Authorise actions outside the model

The tool executor should validate the caller, action, resource and arguments before a write or external request. Give it only the permissions needed for the task. Require approval for actions selected by the application’s risk assessment, such as changing a payment destination. A model’s claim that approval was granted is not an approval record.

05

Measure misses and unnecessary refusals

Use known attacks and ordinary work to measure successful violations, false refusals and the cost of review. Record the model, prompts, data and filter versions behind each result. If checks sit in a shared gateway, test that requests cannot bypass it and that application-specific permissions still apply. A shared filter does not automatically protect every route or every tool.

Sources and further reading

// Key Takeaways

What to remember

  • Enforce document access before retrieval and action permissions at execution.
  • Treat input and output filters as fallible checks.
  • Test both security failures and legitimate requests that get blocked.

// FAQ

Frequently asked questions

Q1

Can a prompt-injection filter guarantee that an LLM is safe?

No. Filters can miss attacks. Restrict document access, validate tool execution and test the consequences of a missed attack as well as ordinary requests.

Q2

Where should tool permissions be enforced?

In the code that executes the tool, against the caller, action, resource and arguments. A model-generated statement of permission is not authorisation.

Last updated:

Prepare evidence for Japanese AI security discussions.

Bring the product’s input and output checks, retrieval permissions, tool controls and known failure cases. StrategyCore can coordinate Japanese technical questions and a bounded product evaluation with your engineers and the prospect’s team.