Browse Documentation
Foundation
Platform
Capabilities
Product
Core Platform
Core Platform
Developers
Operations
Business
Billing and Plans
Billing and Plans
Rust belongs to the same runtime contract, but it should still feel native to its own request boundary.
Async client surface with `Cosantoir::new` and `evaluate_waf`. Choose the native client when the service already lives outside the JavaScript wrapper family. The page should help you choose this surface deliberately, compare it against its lane neighbors, and keep operator proof in reach while you wire the integration.
lane family
4
Native language SDK
package line
1
cosantoir
contract vars
3
Shared across wrappers and native SDKs
operator lanes
2
Plus 2 native package families
Surface fit
Choose this surface when the boundary is real, not convenient.
A better docs system tells you why this lane exists, what makes it distinct, and how it hands off to the rest of the platform.
Use this when
Choose the native client when the service already lives outside the JavaScript wrapper family.
Package line
cosantoir
The install and contract line should stay recognizable even when the request lifecycle changes.
First proof
Protect one real route, loader, or handler first, then read the resulting headers and decision state before broadening the rollout.
Install line
Rust package install
01cargo add cosantoirShared contract
Runtime identity
01COSANTOIR_GATEWAY_URL=http://localhost:400002COSANTOIR_API_KEY=dp_live_example03COSANTOIR_SITE_ID=site_prod_webContract discipline
The framework changes. The contract should not.
This is the point where the left rail, page body, and right rail need to agree: the package can change, but the gateway origin, runtime key, site id, and proof loop stay the same.
01
COSANTOIR_GATEWAY_URL
Keep this value aligned across application middleware, direct SDK probes, and operator tooling so the same request path stays explainable.
02
COSANTOIR_API_KEY
Keep this value aligned across application middleware, direct SDK probes, and operator tooling so the same request path stays explainable.
03
COSANTOIR_SITE_ID
Keep this value aligned across application middleware, direct SDK probes, and operator tooling so the same request path stays explainable.
Lane neighbors
Neighbor surfaces
A mature docs system makes adjacent choices visible. If this page is not the right boundary, the best alternative should already be in front of you.
Native language SDK
Go
Typed client with `NewClient`, `EvaluateWAF`, and `EvaluateBot` for Go services.
Native language SDK
Python
Direct evaluator client with `waf_evaluate`, `bot_evaluate`, and `ip_lookup`.
Native language SDK
Python + Flask
Direct evaluator client inside Flask `before_request` hooks and route handlers.
Handoff
Node.js
Direct evaluator client for custom servers, bespoke middleware order, and exact transport control.
Handoff
CLI
Terminal lane for login, request probes, and telemetry-backed operator workflows.
Handoff
MCP
Model-facing tool server for safe policy and evaluator access.
Launch route
Quickstart
Wire a first protected request and stop only when the receipt is explainable.
Control map
Architecture
Trace how the wrapper, gateway, evaluator, and dashboard stay on the same contract line.
Operator lane
CLI
Bootstrap credentials, run probes, and inspect runtime decisions without leaving the terminal.
Agent lane
MCP
Expose bounded runtime tools to model workflows without widening system reach.
Detailed guide
Rust page guide
The framework-specific instructions live below, but they now sit inside a stronger system: lane fit above, contract line beside, neighbors nearby.
# Rust SDK
The Rust client gives you a typed, async evaluation path for service code that already lives in a Rust stack.
## Installation
``bash
cargo add cosantoir
`
## Example
`rust
use cosantoir::{Cosantoir, CosantoirOptions};
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let client = Cosantoir::new(CosantoirOptions {
base_url: std::env::var("COSANTOIR_GATEWAY_URL").unwrap(),
api_key: std::env::var("COSANTOIR_API_KEY").unwrap(),
site_id: Some(std::env::var("COSANTOIR_SITE_ID").unwrap()),
timeout_ms: 5000,
})?;
let waf = client.evaluate_waf("198.51.100.24", "POST", "/api/signup").await?;
println!("{:?}", waf.result);
Ok(())
}
``