SDK API reference
Every exported constant, variable, function and type of every package in the published bide modules, with its declaration and the first sentence of its doc comment. It is generated from the Go sources, so it cannot drift from them; the full documentation of a symbol is its doc comment, on pkg.go.dev or in the source. The ports and how to implement them are in extension points; the module layout is in module structure.
Packages are listed for linux/amd64 with cgo enabled. Packages under internal/, the bide and bide-hsm programs, the examples and the repo-only test modules are not part of the API and are not listed.
Stability labels
Each package carries one label, declared in one place and checked against stability and support, which says what each means:
- core: breaking changes only in a minor release, listed under Changed in the changelog with a migration note.
- experimental: may change in any release.
- building block, not yet used by approval gates: implemented and tested, but no approval gate calls it yet.
Modules
| Module | Packages | Pages |
|---|---|---|
github.com/bide-ai/bide | 24 | one page per package, listed below |
github.com/bide-ai/bide/anchor/awss3 | 2 | anchor-awss3 |
github.com/bide-ai/bide/anchor/gcs | 2 | anchor-gcs |
github.com/bide-ai/bide/codec/gcf | 1 | codec-gcf |
github.com/bide-ai/bide/flowedit | 1 | flowedit |
github.com/bide-ai/bide/govern | 2 | govern |
github.com/bide-ai/bide/govern/postgreslog | 1 | govern-postgreslog |
github.com/bide-ai/bide/govern/redislog | 1 | govern-redislog |
github.com/bide-ai/bide/govern/sqlitelog | 1 | govern-sqlitelog |
github.com/bide-ai/bide/mcptools | 1 | mcptools |
github.com/bide-ai/bide/signer/awskms | 1 | signer-awskms |
github.com/bide-ai/bide/signer/azurekv | 1 | signer-azurekv |
github.com/bide-ai/bide/signer/gcpkms | 1 | signer-gcpkms |
github.com/bide-ai/bide/signer/pkcs11 | 2 | signer-pkcs11 |
github.com/bide-ai/bide/store/postgres | 1 | store-postgres |
github.com/bide-ai/bide/store/sqlite | 1 | store-sqlite |
github.com/bide-ai/bide/trace | 1 | trace |
Packages
| Package | Stability | Synopsis |
|---|---|---|
agent | core | Package agent is the core of bide, a Go framework for AI agents that move money: a durability-first, Go-idiomatic toolkit whose side effects fire at most once, whose approvals are signed and counted by k-of-n, and whose every action is provable afterwards. |
agent/agenttest | core | Package agenttest holds test doubles and helpers for code built on package agent: a scripted model that plays back the turns you give it, so an agent runs with no provider or API key (ScriptedModel, NewScriptedModel, ToolTurn, TextTurn, ErrorTurn); a Store that counts its round trips (CountingStore); and constructors that panic instead of returning an error (MemJournal, MustJournal, MustNew, Must), for tests whose setup cannot fail. |
agent/storetest | core | Package storetest checks that an agent.Store meets the requirements the journal builds on (A1 to A8, documented on agent.Store), that a Journal over it writes and checks the journal format header, and that records round-trip byte for byte. |
approvals | core | Package approvals is the intake an application serves so that approvers can decide on gated calls over HTTP: an http.Handler that shows a pending call from the journal, and takes an approver's signed decision, verifies it against the recorded call, and records it through the application's own journal. |
audit | core | Package audit turns an agent's durable journal into a verifiable, tamper-evident record. |
audit/anchorobj | experimental | Package anchorobj is the part of an object-store audit anchor that does not depend on any storage SDK: the layout of the objects that hold signed tree heads, their canonical body, the checks a Reader makes on an object it reads back, the equivocation check, and the tripwire for run IDs that look like personal data. |
audit/crlrefresh | experimental | Package crlrefresh keeps the status snapshot of a certificate-bound approver (audit.CertApprover) supplied with the newest verified CRLs of the issuing CAs its policy pins, and archives every CRL it accepts (docs/design/crl-refresher.md, docs/guides/certificate-approvers.md). |
audit/eventstoretest | core | Package eventstoretest checks that an audit.EventStore keeps the contract the event trail builds on: contiguous, append-only positions per run, an idempotent re-append of the same leaf, a refusal (audit.ErrSeqTaken) of a different leaf at a stored position, and exactly one winner among writers racing for one position. |
audit/rfc3161 | building block, not yet used by approval gates | Package rfc3161 verifies RFC 3161 time-stamp tokens with the standard library alone. |
audit/verify | core | Package verify is a dependency-light, standalone verifier for Bide audit proofs. |
chaos | experimental | Package chaos is a deterministic crash-injection benchmark for agent runtimes: it drives a NON-IDEMPOTENT side effect through a fault schedule and checks it fires at most once. |
eval | experimental | Package eval is a statistical evaluation harness for agents. |
middleware | core | Package middleware provides composable func(Handler) Handler batteries for the model call, the "LiteLLM for Go" layer at the semantic level (handlers see messages, tool calls, and token usage, not raw bytes). |
model/anthropic | core | Package anthropic adapts Anthropic's Messages API to agent.Model. |
model/gemini | core | Package gemini adapts Google's Gemini generateContent API to agent.Model. |
model/modeltest | core | Package modeltest checks an HTTP-backed agent.Model against the streaming contract the agent loop relies on: |
model/openai | core | Package openai adapts the OpenAI Chat Completions API to agent.Model. |
model/provider | core | Package provider is the kit a model adapter is built from: HTTP error classification, SSE framing, a cap on a streamed reply, Retry-After parsing, and the tool-result codec. |
notify | core | Package notify ships bide's webhook notifier: a signed HTTPS POST of a structured notification, and the receiver-side Verify that checks one. |
notify/relay | experimental | Package relay receives bide's signed webhooks and forwards each verified notification to Slack, PagerDuty, or any other Sink. |
plan | experimental | Package plan is rung-1 of the expression-surfaces stack: a handle-based flow builder that lowers to the journal-backed runtime and adds no new executor. |
plan/planview | experimental | Package planview embeds bide view's flow-config page in a program, with the program's plan.Registry, so the page checks a config the way plan.Load does: blocks, predicates, merges and types, as well as structure, and shows the digest a run of the flow would journal. |
schema | core | Package schema derives JSON Schema from Go types and emits provider-specific dialects. |
theme | experimental | Package theme is the theme layer of bide's visual pages: a theme is a small JSON file of typed values (colours, enums, numbers in ranges), never CSS. |
anchor/awss3 | experimental | Package awss3 is an audit.Anchor that writes every signed tree head as an object in an S3 bucket under Object Lock (a WORM store), and a Reader that reads the heads back and verifies them. |
anchor/awss3/awss3test | experimental | Package awss3test is an in-memory S3 bucket with versioning and Object Lock, for testing code that uses the awss3 package without a network. |
anchor/gcs | experimental | Package gcs is an audit.Anchor that writes every signed tree head as an object in a Google Cloud Storage bucket whose retention policy is locked (a WORM store), and a Reader that reads the heads back and verifies them. |
anchor/gcs/gcstest | experimental | Package gcstest is an in-memory gcs.Store that models the parts of Cloud Storage the anchor relies on: object generations, create-only writes (ifGenerationMatch=0), a bucket retention policy that can be locked, noncurrent generations under versioning, temporary holds, per-object retention and Cloud KMS keys. |
codec/gcf | core | Package gcf provides a provider.ToolResultCodec that encodes tool results as GCF (Graph Compact Format) instead of JSON when they are sent to the model. |
flowedit | experimental | Package flowedit is the edit engine of the flow editor (docs/design/visual-editor.md): it applies one operation to the text of a flow config by splicing, so every byte outside the edit is the original byte, and it returns the text only after checking that the result means what the operation says (it re-parses the result and compares it with the operation applied to the data). |
govern | experimental | Package govern is the Tier-2 (distributed / concurrent) compensating-agent layer: it integrates the gsm "Governed State Machine" library so that MULTIPLE concurrent agents mutating SHARED state converge to the same valid state regardless of interleaving, as certified by gsm's build-time normalization-confluence verification (WFC + CC). |
govern/eventlogtest | experimental | Package eventlogtest checks that an implementation satisfies the govern.EventLog contract, so every adapter (in-memory, SQLite, Postgres, Redis, or your own) is held to the same guarantees a governor relies on: dense, unique positions under concurrent appends from separate processes, appends that are idempotent by id (so a retried append is recorded once), and a log that only ever grows at the end. |
govern/postgreslog | experimental | Package postgreslog is a Postgres-backed govern.EventLog for HIGH-AVAILABILITY governed state: multiple processes read the same governed event stream and replay it to the same convergent state. |
govern/redislog | experimental | Package redislog is a durable, networked govern.EventLog backed by Redis Streams, the "no SQL database required" adapter. |
govern/sqlitelog | experimental | Package sqlitelog is a durable, on-disk govern.EventLog backed by single-file SQLite (zero-cgo). |
mcptools | core | Package mcptools adapts a Model Context Protocol server's tools into agent.Tool. |
signer/awskms | core | Package awskms is an audit.Signer whose Ed25519 or ECDSA P-256 private key lives in AWS KMS. |
signer/azurekv | core | Package azurekv is an audit.Signer whose ECDSA P-256 private key lives in Azure Key Vault or Azure Key Vault Managed HSM. |
signer/gcpkms | core | Package gcpkms is an audit.Signer whose Ed25519 or ECDSA P-256 private key lives in Google Cloud KMS. |
signer/pkcs11 | core | Package pkcs11 is an audit.Signer whose private key lives in a PKCS#11 token: a hardware security module, a smart card, or SoftHSM2 for tests. |
signer/pkcs11/pkcs11test | core | Package pkcs11test gives tests a SoftHSM2 token to sign with, so code that uses the signer package can be tested against a real PKCS#11 library with no hardware. |
store/postgres | core | Package postgres is a Postgres-backed agent.Store for high-availability durable agents: shared Postgres storage lets any node resume any run, so a dead worker's in-flight agents pick up elsewhere. |
store/sqlite | core | Package sqlite is the default on-disk agent.Store: a single-file, zero-cgo SQLite journal (via modernc.org/sqlite). |
trace | core | Package trace adds OpenTelemetry GenAI instrumentation to an agent, opt-in, so the core agent package carries NO OTel dependency (a user who doesn't import trace pays nothing; contrast frameworks whose core drags the full OTel + Temporal stack into every binary). |