agent-shadow-mode 0.1.0

Toggle shadow mode for agent tool calls: record what would have happened without running real side-effecting code.
Documentation
  • Coverage
  • 70%
    14 out of 20 items documented1 out of 15 items with examples
  • Size
  • Source code size: 29.31 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 423.33 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 6s Average build duration of successful builds.
  • all releases: 6s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Homepage
  • MukundaKatta/agent-shadow-mode-rs
    0 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • MukundaKatta

agent-shadow-mode

Toggle shadow mode for agent tool calls. When active, records the intended call and returns a safe placeholder without running real side-effecting code.

Usage

use agent_shadow_mode::ShadowMode;
use serde_json::json;

let mut shadow = ShadowMode::new(true); // start in shadow mode

let result = shadow.intercept(
    "charge_card",
    json!([]),
    json!({"customer_id": "cus_1", "amount_usd": 4.99}),
    json!({"status": "shadowed"}),
    || json!({"status": "charged"}), // real call — never runs when active
);
assert_eq!(result, json!({"status": "shadowed"}));

// Later: toggle off for real execution
shadow.deactivate();

// Persist the shadow log
shadow.to_jsonl("shadow-audit.jsonl").unwrap();

License

MIT OR Apache-2.0