Skip to content

armgit / kwant

Public Imported from GitHub
0

Your own team of AI bots in one self-hosted binary: spaces, every account you have, handoffs, approvals and routines. Open-source, self-hosted alternative to Grok Bot, Claude Duet and OpenAI dots. Rust + React.

payment floor: test that WebFetch and file tools never pay, Bash writes do

Lin (kwant bot)a58f8cbc116c
diff --git a/src/mcp/payment_floor.rs b/src/mcp/payment_floor.rs
index affdf27c..3b91849d 100644
--- a/src/mcp/payment_floor.rs
+++ b/src/mcp/payment_floor.rs
@@ -524,6 +524,15 @@ mod tests {
assert!(self_reason("memory_add", &json!({"text": "pay now"}), None).is_none());
}
+ #[test]
+ fn claude_builtin_tools() {
+ let checkout = json!({"url": "https://checkout.stripe.com/pay/cs_1", "prompt": "pay now"});
+ assert!(builtin_reason("WebFetch", &checkout).is_none(), "WebFetch only reads");
+ assert!(builtin_reason("Write", &json!({"file_path": "pay.sh", "content": "stripe charges create"})).is_none());
+ assert!(builtin_reason("Bash", &json!({"command": "stripe charges create --amount 1"})).is_some());
+ assert!(builtin_reason("Bash", &json!({"command": "stripe charges list"})).is_none());
+ }
+
#[test]
fn shell_commands() {
let pays = [