Agent Control

repository·main·Indexed 42 days ago

https://github.com/agentcontrol/agent-control

A centralized safety layer for AI agents that enforces runtime guardrails. It allows developers to define security controls, such as PII protection and prompt injection defense, across multiple agents without modifying core logic. Version 8.7.0 includes a framework of controls, scopes, selectors, and evaluators, with SDKs for Python and TypeScript and integrations for LangChain, CrewAI, and DeepEval.

Tokens
95.6K
Snippets
267
Records
403
Agent score
56%

What's inside Agent Control

  1. Overview of Agent Control SDKs

    main

    The Agent Control SDKs allow you to register agents, manage controls, and evaluate requests from your application. There are two primary implementations available:

    • Python SDK: The primary SDK, featuring the @control() decorator and asynchronous client APIs.
    • TypeScript SDK: Consists of a generated OpenAPI client supplemented with TypeScript wrappers.
  2. Overview of Agent Control Telemetry

    main

    Agent Control Telemetry provides shared telemetry contracts used across the Agent Control SDK and server. It defines reusable abstractions to ensure consistent observability. Key components include:

    • Sink Contracts: Definitions for both synchronous (sync) and asynchronous (async) data sinks.
    • Trace-Context Helpers: Utilities for managing and propagating trace contexts across distributed components.
  3. Overview of Agent Control Built-in Evaluators

    main

    The agent-control-evaluators package provides a set of standard evaluators used by the Agent Control server and SDK runtime to perform common validation tasks:

    • regex: Performs pattern matching using regular expressions.
    • list: Validates values against allow/deny lists.
    • json: Validates data against a specific JSON schema.
    • sql: Validates SQL queries to ensure they meet specific criteria.
  4. Overview of Agent Control Server capabilities

    main

    The Agent Control Server is a FastAPI-based server that acts as the central management hub for the Agent Control ecosystem. It provides:

    • Agent Management: Registration of agents and association with specific controls.
    • Control Management: CRUD operations for controls and configuration of evaluators.
    • Runtime Evaluation: An endpoint at /api/v1/evaluation that supports pre- and post-processing stages to evaluate requests.
    • Observability: Endpoints to monitor system events and statistics.
    • Security: API key authentication for production environments.
  5. Overview of the TypeScript SDK capabilities

    main

    The TypeScript SDK allows consumers to interact with the Agent Control platform. This specific example demonstrates the following core capabilities:

    • Generated client usage: Interacting with the platform via a generated client.
    • Agent and control API calls: Managing agents and applying controls through the API.
    • Health check flow: Implementing basic health monitoring for the agent integration.
  6. Explore Agent Control documentation and examples

    main

    The Agent Control documentation is organized into three main areas:

    Core Documentation

    • Overview & Concepts: Understand how controls, scopes, selectors, evaluators, and actions work together.
    • Setup & Configuration: Guides for installation, starting the server, configuring environment variables, authentication, and running the UI dashboard.
    • API Reference: Detailed documentation for the SDKs and the server API.

    Examples & Patterns

    • End-to-End Demos: See the system in action with the Agent Control Demo.
    • Framework Integrations: Implementation patterns for LangChain (e.g., SQL injection protection), CrewAI (guardrails for orchestration), and DeepEval (custom evaluators).

    Component Documentation

    • SDKs: Specific usage guides for the Python SDK (decorators and client APIs) and the TypeScript SDK.
    • Infrastructure: Details on the FastAPI server, the Evaluation Engine (evaluator discovery), and shared Pydantic models.
  7. Explore Agent Control Examples

    main

    The examples/ directory contains runnable implementations demonstrating various integration patterns for Agent Control. Each example includes a quick-run section and links to full documentation walkthroughs.

    Key integration patterns demonstrated include:

    • Framework Integrations: CrewAI, LangChain (SQL Agent), and AWS Strands.
    • Google ADK Integration Patterns: Using AgentControlPlugin (recommended), lifecycle callbacks, or the @control() decorator for tool-specific protection.
    • Evaluator Implementations: Custom evaluators using DeepEval or direct Galileo Luna scorers.
    • Security Scenarios: PII protection, prompt-injection defense, and protecting SQL agents from dangerous queries.
    • Advanced Control Patterns: Dynamic control updates, steering actions (observe, deny, steer), and binding controls to external target contexts (e.g., env=prod).
  8. Explore contributed evaluators and templates

    main

    The evaluators/contrib/ directory contains community-contributed evaluators and starter templates for extending the Agent Control framework.

    Available components:

    • galileo/: Integration for the Luna evaluator.
    • template/: A starter template designed to help developers implement and add their own new evaluators to the system.

    For a detailed implementation guide on creating custom evaluators, refer to the official documentation at: https://docs.agentcontrol.dev/concepts/evaluators/custom-evaluators

  9. Manage agents and controls via the Agent Control UI

    main

    The Agent Control UI provides a visual interface for several management tasks without requiring code changes:

    • Control Management: Create, enable, disable, and edit controls.
    • Agent Association: Associate specific controls with agents and review which configurations are currently active.
    • Real-time Monitoring: Monitor evaluations, denials, and recent activity as they occur.
    • Evaluator Inspection: Inspect different evaluator types and their specific configuration details in a centralized view.
  10. Overview of Agent Control Evaluators

    main

    Agent Control provides four built-in evaluators designed to intercept and validate agent requests or responses at different stages of the execution lifecycle. They can be used to block unsafe operations, enforce access controls, validate schemas, or detect sensitive information in outputs.

    EvaluatorStagePurposeExample
    SQLPREValidate query structure and safetyBlock DROP, enforce LIMIT
    LISTPREAccess control via allowlists/blocklistsRestrict sensitive tables
    REGEXPOSTPattern detection in free-text outputCatch SSN, email, credit cards
    JSONPRESchema validation with constraintsRequire fields, enforce ranges
  11. What is the Agent Control Engine?

    main

    The Agent Control Engine is the runtime component responsible for applying control logic consistently across the ecosystem. It performs three primary functions:

    1. Evaluates controls: Processes the logic defined in your control configurations.
    2. Resolves selectors: Handles payload extraction and selector evaluation.
    3. Runs evaluators: Executes the actual evaluation logic and aggregates the results.

    It is designed to be used by both the Agent Control Server and the SDK to ensure uniform behavior.