Map trust boundaries before writing prompts
Classify every input by origin and authority:- system and application policy;
- authenticated user input;
- retrieved enterprise content;
- external web or third-party content;
- tool output;
- conversation memory and generated summaries.
Give tools the minimum authority
Tool security starts outside the model. Each tool should expose the narrowest useful operation, with a typed input contract and an identity that can be authorized independently. For every tool, define:- allowed callers and user context;
- required and optional arguments;
- accepted values and size limits;
- read versus write behavior;
- idempotency and retry policy;
- timeout and rate limits;
- data classification;
- audit events;
- confirmation requirements.
Validate the complete action path
Before a tool call reaches a side effect:- parse the output against a strict schema;
- reject unknown fields and unsafe values;
- bind the request to the authenticated identity;
- recheck resource-level permission;
- apply business invariants;
- require confirmation for high-impact actions;
- attach an idempotency key where retries are possible;
- record the decision and result without leaking secrets.
Protect sensitive data across the workflow
Sensitive data can leak through prompts, tool arguments, traces, cached entries, model outputs, or human review queues. Apply the same data policy to all of those surfaces. Useful controls include:- data minimization before model calls;
- DLP or pattern-based inspection where appropriate;
- tenant-aware retrieval and cache keys;
- encryption and retention controls;
- redaction in logs and evaluation datasets;
- provider and regional routing policy;
- output validation before display or downstream use.
Make unsafe outcomes observable
Security telemetry should answer:- which untrusted source influenced the request;
- what policy and tool version were active;
- why a tool call was allowed, blocked, or escalated;
- whether sensitive data was detected or redacted;
- whether confirmation was required and obtained;
- what side effect occurred;
- which fallback was used.