The outcome
Use hosted and custom tools without prompt-injection escalation, cross-tenant access, duplicate side effects, or leaked credentials.
Step by step
A workflow you can repeat.
- 01
Define an allowlist of narrow tools, user and tenant roles, data boundaries, schemas, side effects, approval thresholds, budgets, retries, stopping conditions, and audit fields.
- 02
Keep project keys server-side, send a stable privacy-preserving safety identifier for end users, minimize context, and never place credentials or unrestricted URLs in prompts or tool descriptions.
- 03
Parse tool calls as untrusted, reject unknown names and fields, canonicalize inputs, reauthorize against current server state, and require explicit confirmation for consequential or external writes.
- 04
Execute through scoped service accounts with idempotency, timeouts, rate and spend limits, sandbox code and computer use, and return bounded results with no secrets or excessive records.
- 05
Test direct and indirect injection, confused deputy, tenant crossover, forged IDs, replay, parallel calls, exfiltration, denial, provider failure, safeguard intervention, cancellation, and rollback.
Working standard
What good use looks like.
- Authorize every action outside the model.
- Make side effects idempotent.
- Require approval for consequential tools.
Official references