Overview
Agent Control integrates seamlessly with AWS Strands using native plugin systems that add centralized safety guardrails without modifying your agent code or workflow architecture.Integration Patterns
This integration provides two complementary approaches for adding Agent Control safety guardrails to Strands agents:AgentControlPlugin- Plugin-based integration for tool-stage and model-stage deny checksAgentControlSteeringHandler- Steering-based integration that converts Agent Control steer actions into StrandsGuide()instructions
Key Benefits
1. Dual-mode safety Combine hard blocks (plugin) with soft guidance (steering) for comprehensive protection. Block dangerous operations while guiding the LLM to safer alternatives. 2. Zero code changes Integrate using Strands’ native plugin architecture. No modifications to existing agent code, tools, or workflows required. 3. Multi-stage protection Apply controls at multiple lifecycle stages: before/after model calls, before/after tool calls, before/after node transitions, and at invocation. 4. Intelligent steering Convert control violations into LLM guidance using Strands’ experimental steering API. Agent automatically retries with improved context instead of hard failure. 5. Centralized governance Define and update controls server-side with immediate effect across all Strands agents. No redeployment needed.Common Use Cases
Plugin Pattern (Hard Blocks):- Tool protection - Block dangerous tool operations (database writes, file deletions, API calls)
- PII prevention - Stop sensitive data from entering or leaving tools
- Access control - Enforce authorization checks at tool boundaries
- Compliance enforcement - Apply regulatory controls (GDPR, HIPAA) to tool execution
- Multi-stage validation - Check inputs, outputs, and state transitions across the agent lifecycle
- Content redaction - Guide LLM to remove PII before tool calls
- Response refinement - Steer agent to rephrase responses that trigger controls
- Graceful degradation - Provide alternative approaches when controls block the primary path
- Compliance guidance - Help agents navigate regulatory requirements without hard failure
- Progressive correction - Allow multiple steering attempts before escalating to denial
Architecture
Plugin Pattern:Installation
Components
AgentControlPlugin
Plugin-based integration that enforces Agent Control controls at multiple stages of agent execution:- Before and after model calls (LLM inputs and outputs)
- Before and after tool calls (tool arguments and results)
- Before and after node calls (workflow transitions)
- Before invocation (initial request validation)
- Automatic registration with Strands’ plugin registry
- Configurable event control list (choose which stages to check)
- Hard blocks (deny actions) raise
ControlViolationError - Steer actions raise
ControlSteerErrorwith steering context - Optional callback support for custom handling
AgentControlSteeringHandler
Steering-based integration that uses Strands’ experimental steering API to guide agents based on Agent Control steer actions. Key features:- Converts Agent Control steer matches into Strands
Guide()actions with steering context (soft guidance) - Deny matches raise
ControlViolationError(hard block)
- LLM generates output
- Steering handler evaluates output against Agent Control controls
- If steer match found:
- Extracts steering context from control result
- Returns
Guide(steering_context)to Strands - Strands adds guidance to next LLM call
- Agent retries with improved context
- If deny match found:
- Raises
ControlViolationError - Execution stops
- Raises
Implementation Details
How it works
Both integrations use Agent Control’s evaluation engine to check agent behavior against server-side controls:- Agent Control server - centralized control engine that evaluates controls
- Strands agent - AWS Strands agent with plugin integration
- Integration layer -
AgentControlPluginorAgentControlSteeringHandler - Plugin system - Strands’ native extension points
Dual-layer governance
You can use both components together for comprehensive protection:- Plugin: enforces hard blocks on strands events
- Steering: guides LLM to before or after events
Error Handling
Both integrations raise standard Agent Control exceptions:-
ControlViolationError- hard block (deny action)- Contains:
control_id,control_name,message,metadata - Should be caught and handled by your application
- Contains:
-
ControlSteerError- steering suggestion (steer action, plugin only)- Contains:
steering_context,control_name - Can be caught to extract steering guidance
- Contains:
Configuration
Both components support:agent_name(required) - Agent identifier for control lookupenable_logging(optional) - Enable debug logging (default:True)
event_control_list- List of Strands events to monitor (default: all)on_control_match- Custom callback for control matchesuse_runtime_error- RaiseRuntimeErrorinstead ofControlViolationError
steers_applied- Counter for applied steering actionslast_steer_info- Last steering match info (for debugging or UI)
Best Practices
- Use plugin for tool protection
- Use steering for content guidance
- Combine both for defense-in-depth
- Test controls incrementally
- Monitor steering stats
Requirements
- Python 3.12+
agent-control-sdkstrands-agents(AWS Strands framework)- Running Agent Control server