Repository navigation
bide v0.4.0
m-of-n human approval, provable offline.
A tool can now require k signed approvals from a named set of n approvers before it runs. The run pauses durably until enough decisions arrive, proceeds at k, and denies once k can no longer be reached.
refund := agent.Func("refund", "refund the order",
agent.Safety{Approval: &agent.ApprovalPolicy{Need: 2, Approvers: []string{"ops", "finance", "risk"}}},
doRefund)
a := agent.New(model, store, refund).WithApproverVerifiers(keysByApprover)
// each approver signs the exact call they were shown
sig, _ := signer.Sign(agent.ApprovalDecisionBytes(pend.Subject(), "finance", true))
agent.ApproveAs(ctx, store, pend.RunID, pend.ToolUseID, "finance", true, sig)Each signature covers the call itself (tool and arguments), so it approves that call and nothing else. A forged or mistaken decision is ignored and does not lock its approver out. Afterwards, audit.VerifyApprovals, or bide-audit verify-approvals for auditors who do not write Go, checks from a portable evidence file that k named approvers signed off on this call before it ran, under the expected policy, and that the evidence leaves no decision out.
A runnable walk-through, with every actor in its own process: examples/approval. Guide: Approval.
Fix: re-invoking a finished run could repeat a side effect. Calling a run again after it had finished (a retry after a lost response, a redelivered job, a sub-agent or session turn re-entered on resume) asked the model for another turn, and a repeated tool request under a new call id could run again. A finished run now returns its recorded answer without calling the model. This affects v0.1.0 through v0.3.0; upgrading is recommended. As a result, calling Run on a finished run id with new input returns the original answer; use Session to continue a conversation.
Everything else from v0.3.0 stands.
Install:
go get github.com/bide-ai/bide@v0.4.0
Docs: https://bide-ai.com