1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
//! 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.
//!
//! ```no_run
//! use cots::agents::{AgentClient, AgentConfig, NormalizedAction};
//!
//! # async fn example() -> Result<(), cots::SdkError> {
//! 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?;
//! # Ok(())
//! # }
//! ```