Skip to main content

Crate cots

Crate cots 

Source
Expand description

Cots.ai SDK for Rust.

cots::agents is the agent interceptor client: configure once with your tenant_id/agent_id, then call agents::AgentClient::guard around every real-world action your agent takes — it calls the interceptor (PEP/PDP) first and only runs your callback if the decision is allowed (immediately) or require_approval (after a human decides). blocked never runs your callback at all.

Future modules (e.g. cots::policy, cots::audit) would live alongside agents here, each gated behind its own Cargo feature if the crate grows enough that pulling in every module’s dependencies stops being cheap.

use cots::agents::{AgentClient, AgentConfig, NormalizedAction};

let agent = AgentClient::new(AgentConfig::new("ten_xxx", "agt_xxx"));

let result = agent
    .guard(NormalizedAction::new("Slack", "send_slack_message"), || async {
        // send the real Slack message here
        "sent"
    })
    .await?;

Modules§

agents
The agent interceptor client: cots::agents::AgentClient.

Enums§

SdkError