Skip to main content
Automatic safety controls for AWS Strands agents using hooks - no decorators needed.

Quick Start

Prerequisites: Python 3.12+, OpenAI API key, AgentControl server
Open http://localhost:8501 and click test buttons to see safety controls in action.

Available Demos

Interactive Demo

Customer support agent with PII blocking and SQL injection prevention. Shows real-time safety checks in Streamlit UI.

Steering Demo

Banking email agent with PII redaction. Combines AgentControl Hook (deny on tool calls) and Strands Steering (steer on LLM draft) for layered governance. Uses a two-phase draft to send flow so steer can guide before tool calls.

How It Works

AgentControlHook provides automatic safety without code changes.
Hook intercepts events, the server evaluates controls, and the hook enforces the decision. For steer actions, the steering handler converts AgentControl steer into a Strands Guide() retry.

Controls

LLM Controls

Apply to all model interactions:

Tool Controls

Target specific tools:
Hook automatically extracts tool names from events - no decorators needed.

Architecture

Integration Patterns

Basic Setup

Steering Integration

  • AgentControlHook for tool-stage deny (hard blocks)
  • AgentControlSteeringHandler for LLM steer to Guide() (corrective guidance)
See steering_demo/README.md for a complete implementation.

Source Code

View the complete example with all scripts and setup instructions: Strands Agents Integration Examples

Troubleshooting

AgentControl not initialized

Run agent_control.init() before creating the hook.

Controls not triggering

  • Server running? curl http://localhost:8000/health
  • Controls exist? Re-run setup_*_controls.py

Import errors

Install dependencies: uv sync or pip install -e .

Files

  • interactive_demo/ - Customer support demo with PII/SQL injection blocking
  • steering_demo/ - Banking email demo with PII redaction