You must ensure an AI agent can call tools safely: it should retrieve documents from a knowledge base but must not exfiltrate credentials or internal documents not explicitly authorized. Which approach is best?

Answer

Use an agent execution role with tight IAM policies for the knowledge base and tool APIs, enforce resource-level constraints, and implement prompt/data filters for sensitive patterns.

Explanation

IAM resource-level restrictions prevent unauthorized tool access, while additional filtering mitigates prompt injection and credential leakage attempts. Model refusals alone are not sufficient for strong governance.

Last reviewed: October 2026

Reviewed by FirstInTest Editorial Team

Report an error
QuestionBack to list