Agent Permission Guardrail and Tool Definition Sanitization Memo
Rewrites agent instructions and tool interfaces to enforce least-privilege security boundaries.
Use this prompt when autonomous agents with tool-calling capabilities exhibit privilege creep, prompt injection vulnerabilities, or insecure parameter passing. It generates a critical email rewrite directive for software and security engineers.
Role: AI Security & Prompt Engineering Director specializing in sandbox escape mitigation and tool-invocation security.
Context
- Target Agent Cluster: {{target_agent_cluster}}
- Vulnerable Tool Definitions: {{vulnerable_tool_definitions}}
- Observed Exploit Vectors: {{observed_exploit_vectors}}
- Sanitization Policy Level: {{sanitization_policy_level}}
- Audit Deadline: {{audit_deadline}}
- Affected Engineering Squad: {{affected_engineering_squad}}
Task
Draft a security directive email to {{affected_engineering_squad}} delivering fully rewritten tool descriptions and system instruction guardrails that eliminate {{observed_exploit_vectors}} across {{target_agent_cluster}} prior to {{audit_deadline}}.
Method
- Review {{vulnerable_tool_definitions}} against {{observed_exploit_vectors}} to isolate injection vectors, excessive permissions, and unvalidated arguments.
- Apply {{sanitization_policy_level}} standards to rewrite tool schemas, restricting parameter types to strict enums and bounded regex patterns.
- Construct defensive prompt boundaries inside the agent's tool-routing meta-instructions to disallow unauthorized cross-tool chained calls.
- Draft mandatory user-confirmation triggers for high-impact tool invocations (e.g., write, update, delete operations).
- Detail the exact sanitization diffs for each vulnerable function definition in {{vulnerable_tool_definitions}}.
- Specify automated negative testing prompts to verify resistance against indirect prompt injection.
- Format the output into an executive security email ready for operational deployment.
Constraints
- MUST write all tool constraints using non-negotiable directive syntax (e.g., 'NEVER execute without validation').
- MUST NOT reduce agent utility for approved, legitimate tool workflows.
- Security diffs MUST include explicit parameter allowlists.
- The email MUST set unambiguous ownership requirements for {{affected_engineering_squad}}.
Output format
An email composed of the following sections:
- Subject Line: [SECURITY ACTION REQUIRED] Tool Sanitization & Guardrail Rewrites for {{target_agent_cluster}}
- Threat Summary & Vulnerability Exposure (concise paragraph)
- Tool Definition Diffs (Before vs. Hardened After with Exploit Mitigations)
- System Prompt Guardrail Injection Rules
- Validation Protocol & Penetration Test Cases
- Compliance Timeline (referencing {{audit_deadline}})
Self-review
- Does every rewritten tool enforce the {{sanitization_policy_level}} standard?
- Are all identified vectors in {{observed_exploit_vectors}} directly mitigated?
- Is the verification protocol clear enough for immediate automated testing?
Explicit role, a named task, and discrete steps the model can follow.
Background, inputs and variables the model needs before it starts.
Hard boundaries — what the model must and must not do.
A named, field-level shape for the response.
Ordered work items that force analysis before an answer.
Length and structure that travel across frontier models.
Signal density — instruction weight without padding.
Documented variables so the scaffold adapts to new inputs.
Quality bar, assumptions and behaviour when inputs are thin.
How much real usage the template has behind it.