Skip to content

Secure for production

An agent in production takes untrusted input, calls tools with real permissions, and returns model output to real users. Securing it means putting controls at each of those boundaries: screen what goes in and out with guardrails, write system prompts that hold up against injection, treat any history you did not produce as untrusted, and keep personal data out of your telemetry. The agent you built does not change; you wrap it in the safeguards production demands.

The most direct control is a guardrail on the model boundary. Configure one on the model provider and every prompt and response the agent handles is screened against it, with blocked content redacted from the conversation before it reaches the model again.

from strands import Agent
from strands.models import BedrockModel
# The guardrail screens every prompt and response; blocked content is redacted
model = BedrockModel(
guardrail_id="your-guardrail-id",
guardrail_version="1",
)
agent = Agent(model=model)
agent("Summarize our refund policy for a customer.")

For the full guardrail configuration, shadow-mode monitoring, and providers without native guardrails, see Add guardrails.

Shipping an agent for the first time? Start with guardrails to put a control on the model boundary, then harden your prompts so the system prompt holds up against adversarial input. If your agent loads history from a request body or a shared store, read trusted message history before you do.

Handling personal data or operating in a regulated environment? Add PII redaction to your telemetry pipeline and follow the responsible AI practices for tool design and audit logging.