Module agents

Module agents 

Source
Expand description

Agent integration module for Sentinel proxy.

This module provides integration with external processing agents for WAF, auth, rate limiting, and custom logic. It implements the SPOE-inspired protocol with bounded behavior and failure isolation.

§Architecture

  • AgentManager: Coordinates all agents, handles routing to appropriate agents
  • Agent: Individual agent with connection, circuit breaker, and metrics
  • AgentConnectionPool: Connection pooling for efficient connection reuse
  • AgentDecision: Combined result from processing through agents
  • AgentCallContext: Request context passed to agents

§Queue Isolation

Each agent has its own semaphore for queue isolation, preventing a slow agent from affecting other agents (noisy neighbor problem). Configure concurrency limits per-agent via max_concurrent_calls in the agent configuration.

§Example

use sentinel_proxy::agents::{AgentManager, AgentCallContext};

// Each agent manages its own concurrency limit (default: 100)
let manager = AgentManager::new(agent_configs).await?;
manager.initialize().await?;

let decision = manager.process_request_headers(&ctx, &headers, &["waf", "auth"]).await?;
if !decision.is_allow() {
    // Handle block/redirect/challenge
}

Structs§

Agent
Individual agent configuration and state.
AgentCallContext
Agent call context.
AgentConnectionPool
Agent connection pool for efficient connection reuse.
AgentDecision
Agent decision combining all agent responses.
AgentManager
Agent manager handling all external agents.
AgentMetrics
Agent metrics collector.

Enums§

AgentAction
Agent action types.