This directory contains example scripts demonstrating how to use Agent Control Plane.
Demonstrates fundamental concepts and basic usage patterns:
- Creating the control plane
- Creating agents with different permission levels
- Executing actions
- Handling permissions and errors
Run:
python examples/basic_usage.pyShowcases advanced capabilities:
- Mute Agent - Capability-based execution
- Shadow Mode - Simulation without execution
- Constraint Graphs - Multi-dimensional context
- Supervisor Agents - Recursive governance
- Reasoning Telemetry - Tracking agent decisions
Run:
python examples/advanced_features.pyShows different configuration patterns and agent profiles:
- Development/Testing agent configuration
- Production agent configuration
- Read-only agent configuration
- Multi-tenant configurations
Run:
python examples/configuration.pyDemonstrates governance for LangChain agents:
- Basic LangChain adapter setup
- Custom tool mappings for company-specific tools
- Blocked action callbacks for monitoring
- Real-world integration patterns
- Statistics and audit trails
Run:
python examples/langchain_demo.pyShows how to create governed MCP servers:
- Basic MCP server with governance
- MCP protocol message handling (JSON-RPC)
- Tool and resource registration
- Error handling for blocked actions
- Integration patterns for MCP clients
Run:
python examples/mcp_demo.pyDemonstrates agent-to-agent communication:
- Creating A2A agents with governance
- Agent Cards for discovery
- Task requests and delegation
- Multi-agent coordination
- Secure inter-agent communication
Run:
python examples/a2a_demo.pyComplete demonstration of the OpenAI SDK adapter:
- Drop-in middleware for OpenAI client
- Tool call interception and governance
- Custom tool mappings
- Production deployment patterns
Run:
python examples/adapter_demo.pyWhen creating examples:
- Import from
agent_control_planepackage - Include clear comments explaining each step
- Use descriptive variable names
- Show both success and error cases
- Keep examples focused on specific features
Example template:
"""
Example: Your Feature Name
This example demonstrates how to use [feature name].
"""
from agent_control_plane import AgentControlPlane, create_standard_agent
from agent_control_plane.agent_kernel import ActionType
def example_function():
"""Demonstrates [specific functionality]"""
# Create control plane
control_plane = AgentControlPlane()
# Your example code here
pass
if __name__ == "__main__":
example_function()The Agent Control Plane supports multiple frameworks and protocols:
- OpenAI SDK: Drop-in adapter for OpenAI client
- LangChain: Governance for LangChain agents and tools
- MCP (Model Context Protocol): Anthropic's standard for tool/resource access
- A2A (Agent-to-Agent): Google/Linux Foundation protocol for agent coordination
All adapters provide the same governance approach with consistent security and audit capabilities.