Rust SDK
Use the Rust SDK for safety-critical workers and high-throughput services.
Install
First-party Rust SDK
Status: Preview
Crate: haltstate
Version: 0.1.0
Local verification status: source present; Rust toolchain verification pending on this host.
Do not claim crates.io publication unless external verification passes. Use the repository source for preview evaluation.
Guard shape
let client = haltstate::Client::new(Config {
tenant_id: Some(std::env::var("HALTSTATE_TENANT_ID")?),
api_key: Some(std::env::var("HALTSTATE_API_KEY")?),
..Default::default()
})?;
let decision = client.check("refund.create", json!({"amount": 126, "currency": "USD"}), Some("refund:lge_123".into())).await?;
// Denied, pending, expired, and engine failure paths must not execute.HTTP guard fallback
let request = GuardRequest {
agent_id: "retail-refund-agent".into(),
action: "refund.create".into(),
idempotency_key: format!("refund:{}", ledger_entry_id),
context: json!({"amount": 126, "currency": "USD"}),
};
// Denied, pending, expired, and engine failure paths must not execute.Implementation notes
Keep the HaltState call as close as possible to the side effect. The agent may plan and draft freely, but the wrapper around the actual action should be the place where authority is checked. That wrapper should send only the context required for policy evaluation: safe identifiers, normalized amounts, action names, risk flags, schedule windows, and redaction status. Raw customer payloads and secrets should stay in the business system or protected operator tooling.
Operational evidence
For each action, preserve the decision, the worker outcome, the idempotency key, safe resource references, latency, proof status, and redaction status. This evidence supports incident response and control narratives because it shows what the system did at runtime rather than only describing what the policy document intended. HaltState supports alignment work; it is not a substitute for legal advice or a compliance certification.