Skip to content

Package audit ​

Go module github.com/bide-ai/bide; all packages.

github.com/bide-ai/bide/audit · pkg.go.dev · Stability: core

Package audit turns an agent's durable journal into a verifiable, tamper-evident record.

Constants

  • const FlagDecidedAfterRecorded: FlagDecidedAfterRecorded: the signed decision time is more than the tolerance after bide recorded the decision, so the approver's clock was running ahead (a decision cannot be recorded before it is made).
  • const FlagDecidedBeforeAsked: FlagDecidedBeforeAsked: the signed decision time is before the run recorded that it paused for approval.
  • const FlagAskedUnknown: FlagAskedUnknown: the evidence does not say when the run asked for approval (no request or pause record with a time, as from an earlier version, or a pause record lost to a crash), so FlagDecidedBeforeAsked could not be checked.
  • const FlagRecordedAtInvalid: FlagRecordedAtInvalid: the decision's recorded_at is missing or not a canonical time.
  • const FlagRecordedOutOfOrder: FlagRecordedOutOfOrder: the decision's recorded_at is more than the tolerance before the recorded_at of a decision journaled earlier, or before the run asked: the journal's order and its times disagree, so a submitter's clock is wrong or the time was not the recording's.
  • const FlagRecordedAfterHead: FlagRecordedAfterHead: the decision's recorded_at is more than the tolerance after the signed tree head that covers its record was signed: the record existed by then, so the time is not when it was recorded.
  • const DefaultAnchorTimeout = 3 * time.Second: DefaultAnchorTimeout is how long AuditedEventStore waits for one head to be built, signed and published before it gives up on it (see AuditedEventStore.WithTimeout).
  • const DefaultAnchorCooldown = 30 * time.Second: DefaultAnchorCooldown is how long, after a failed publish, AuditedEventStore skips publishing before it probes the anchor again (see AuditedEventStore.WithCooldown).
  • const CoverageCovered = "covered": CoverageCovered: a verified signed head over this journal includes the decision's record.
  • const CoveragePending = "pending": CoveragePending: no such head includes it yet, and neither bound has passed.
  • const CoverageOverdue = "overdue": CoverageOverdue: no such head includes it and a bound has passed (see Basis).
  • const BasisRecords = "records": BasisRecords: the journal holds at least CoverageBound.MaxRecords records after the decision and none of the heads covers it.
  • const BasisAge = "age": BasisAge: the decision was recorded more than CoverageBound.MaxAge (plus Tolerance) before CoverageBound.Now.
  • const ProofFormat = "bide.audit.proof.v3": ProofFormat is the format of a ProofBundle.
  • const AbsenceFormat = "bide.audit.absence.v3": AbsenceFormat is the format of an AbsenceBundle.
  • const RunCertificateFormat = "bide.audit.runcert.v3": RunCertificateFormat is the format of a RunCertificate.
  • const CurrentGrantFormat = "bide.audit.current-grant.v3": CurrentGrantFormat is the format of a CurrentGrantProof.
  • const EventInclusionFormat = "bide.audit.event-inclusion.v3": EventInclusionFormat is the format of an EventInclusion.
  • const STHFormat = "bide.audit.sth.v5": STHFormat is the format of a SignedTreeHead, and the tag of the bytes it signs.
  • const AnchorEntryFormat = "bide.audit.anchor-entry.v1": AnchorEntryFormat is the format of an AnchorEntry.
  • const RedactionTrailName = "redact:@log": RedactionTrailName is the name of the deployment's redaction trail in an EventStore. (experimental)
  • const RedactionRecordFormat = "bide.audit.redaction-record.v1": RedactionRecordFormat is the format of a RedactionRecord. (experimental)
  • const RedactionBegin = "begin", const RedactionEnd = "end": Phases of a RedactionRecord. (experimental)
  • const RedactionAcknowledge = "acknowledge": RedactionAcknowledge is the phase of a record in which an operator acknowledges a planted leaf (see AcknowledgeRecord). (experimental)
  • const RedactionHoldPlaced = "hold_placed": RedactionHoldPlaced and RedactionHoldLifted are the phases of the records of a legal hold being placed and lifted (see PlaceLegalHold and LiftLegalHold). (experimental)
  • const RedactionHoldLifted = "hold_lifted": Phases of a RedactionRecord. (experimental)
  • const TreeJournal = "journal": TreeJournal is a run's journal: one leaf per record, in persisted order (NewTreeHead).
  • const TreeEvents = "events": TreeEvents is a run's semantic event stream (EventLog.TreeHead).
  • const TreeToolUse = absenceKindPrefix + "tool-use": TreeToolUse is the sorted, distinct tool-use keys of a run's completed tool calls (ToolUseKeys), the tree tool-call absence proofs verify against.
  • const TreePolicyUsed = absenceKindPrefix + "policy-used": TreePolicyUsed is the sorted, distinct policy digests a run's governed actions used (PolicyUsedKeys), the tree used-policy absence proofs and run certificates verify against.
  • const DefaultClockSkew = 5 * time.Minute: DefaultClockSkew is how far past the verifier's clock a signed head's TimestampNanos may be before it is refused: five minutes, for clocks that are not exactly in step.
  • const DefaultDecisionTimeTolerance = 5 * time.Minute: DefaultDecisionTimeTolerance is how far two clocks may disagree before CheckDecisionTimes flags it: a decision's signed time running ahead of its recorded time, or a recorded time out of journal order or after the signed tree head that covers it.
  • const EarnedScopeLimit = "limit": EarnedScopeLimit is the scope key an earned grant sets to the earned limit (at most the root's).
  • const EvidenceFormat = "bide.audit.evidence.v6": EvidenceFormat is the format/version tag written into every EvidencePackage.
  • const EvidenceFormatV5 = "bide.audit.evidence.v5": EvidenceFormatV5 is the previous evidence format, whose seal covers the whole package JSON rather than its digest.
  • const GrantFormat = "bide.audit.grant.v2": GrantFormat tags the canonical bytes of a grant (Grant.Bytes), which are both signed and digested.
  • const JournalExportFormat = "bide.audit.journal-export.v1": JournalExportFormat is the format of a JournalExport.
  • const LiftAuthorizationFormat = "bide.audit.redaction-authorization.v1": LiftAuthorizationFormat is the format of a LiftAuthorization. (experimental)
  • const MaxStopRecords = 20000: MaxStopRecords bounds the records VerifyStops reads from the control run for its comparison with the trail: past it the comparison is not made and the count is a problem, so a flood of records written into the control run is a finding, not a hang. (experimental)
  • const NoteNoRecordedTime = "no recorded time": NoteNoRecordedTime is DecisionCoverage.Note for a decision whose record has no usable recorded_at.
  • const NoteRedacted = "redacted, name not attested": NoteRedacted is DecisionCoverage.Note for a decision whose record a redaction replaced with a tombstone: its approver, verdict and recorded_at are gone, and it is bounded like any other. (experimental)
  • const NotifyTrailExportFormat = "bide.audit.notify-trail-export.v1": NotifyTrailExportFormat is the format of a NotifyTrailExport.
  • const ReceiptFormat = "bide.audit.decision-receipt.v1": ReceiptFormat identifies a decision receipt.
  • const StopTrailExportFormat = "bide.audit.stop-trail-export.v1": StopTrailExportFormat is the format of a StopTrailExport. (experimental)

Variables

  • var ErrMalformed: ErrMalformed reports an artifact that cannot be read as what it claims to be.
  • var ErrFormat: ErrFormat reports an artifact whose "format" is missing or is not the one this version of the package reads: an artifact produced by an older (or newer) release.
  • var ErrNotVerified = errors.New("audit: not verified"): ErrNotVerified reports an artifact that was read and understood and does not hold.
  • var ErrCertificateBound: ErrCertificateBound reports a certificate-bound decision receipt given to DecisionReceipt.Verify, which knows only a key: use DecisionReceipt.VerifyCertificate.
  • var ErrRedacted: ErrRedacted reports a journal holding a redacted record (agent.Record.Redacted) given to a producer that projects what the records say (an absence key set, a used-policy set, the event stream): the redacted record's content is gone, so the projection would silently omit it, and a key set without it would prove absent a call the journal tree commits. (experimental)
  • var ErrRedactNoHead: ErrRedactNoHead is a redaction of a run no verified signed head covers. (experimental)
  • var ErrRedactTrailUntrusted: ErrRedactTrailUntrusted is a redaction whose trail does not match the signed heads given: it is not the trail they attest (records deleted or changed, or another trail altogether). (experimental)
  • var ErrRedactNoTrail: ErrRedactNoTrail is a redaction whose begin record could not be written. (experimental)
  • var EarnedRules: EarnedRules is the ScopeRules an earned grant attenuates its root under.
  • var ErrCRLSignature: ErrCRLSignature is wrapped by VerifyCRL when the CRL's algorithm is outside the profile, its signature does not verify under the issuer's certificate, or it names another issuer.
  • var ErrLiftUnauthorized: ErrLiftUnauthorized is a lift of a legal hold that needs a second person's signed authorization and has none that checks out: it is refused, and the hold stays in force. (experimental)
  • var ErrRootMismatch: ErrRootMismatch is wrapped by the error of a proof or check that finds a signed tree head's root is not the root of the run's journal at the head's size: the journal was changed after the head was signed, or the head is for another history.
  • var ErrSeqTaken: ErrSeqTaken is what EventStore.Append returns, wrapped, when a different leaf is already stored at the requested seq: the position was taken.
  • var ErrSnapshotFull: ErrSnapshotFull is returned by AddCRLNoEvict when adding the CRL would evict another.
  • var ErrWeakKey: ErrWeakKey reports an Ed25519 public key that is not a usable verification key (see CheckEd25519PublicKey).
  • var PolicyUsedKeys: PolicyUsedKeys is the key set of policy digests exercised by governed actions, keyed "policy_used:<digest>" (see PolicyUsedKey).
  • var ToolUseKeys: ToolUseKeys is the key set of the tool calls a run's model requested, keyed "tooluse:<ToolUseID>" (see ToolUseKey).

Functions

  • func AbsenceRoot(records []agent.Record, set KeySet) (root []byte, size int, err error): AbsenceRoot is the RFC 6962 Merkle root over the run's sorted, distinct keys in set, and the number of keys.
  • func AcknowledgeRecord(ctx context.Context, store EventStore, signer Signer, deployment string, position int, reason, ticket, executor string, now time.Time) error: AcknowledgeRecord appends to the redaction trail a record, signed with signer (the redaction key), in which the operator acknowledges the leaf at position: a planted, replayed or unreadable one that VerifyRedactions reports and that the operator has investigated. (experimental)
  • func AppendRedactionRecord(ctx context.Context, store EventStore, r RedactionRecord, signer Signer) error: AppendRedactionRecord signs r with signer (the redaction key) and appends it to the redaction trail in store, at the next position. (experimental)
  • func ApprovalArgsDigest(s agent.ApprovalSubject) string: ApprovalArgsDigest returns the SHA-256 of the canonical arguments of s, in lowercase hex: the digest a signature over agent.ApprovalDecisionBytes(s, ...) binds.
  • func AttenuatingSubAgent(name, description string, sub *agent.Agent, cfg AttenuationConfig, opts ...agent.ToolOption) agent.Tool: AttenuatingSubAgent wraps a sub-agent as a delegation Tool that attenuates authority by default.
  • func CRLTBSHash(der []byte) ([32]byte, bool): CRLTBSHash is the SHA-256 of the TBSCertList of a CRL's DER, for comparing two CRLs without their (possibly randomised) signatures.
  • func CheckAttenuation(parent, child Grant, rules ScopeRules) error: CheckAttenuation returns nil if child is a valid delegation of parent, and otherwise an error naming the first rule it breaks:
  • func CheckCRLURL(raw string) (*url.URL, error): CheckCRLURL applies the URL rules of a CRL source: http or https, a host, no userinfo, no fragment.
  • func CheckDeclaredGoDebug(declared, environment string) error: CheckDeclaredGoDebug compares the x509 GODEBUG settings an operator declares (CertApprover.GoDebug) with the process's real environment value, which the caller reads (os.Getenv("GODEBUG"): the engine itself reads no environment), and returns an error wrapping agent.ErrConfig when they differ.
  • func CheckEd25519PublicKey(pub []byte) error: CheckEd25519PublicKey reports whether pub is a usable Ed25519 verification key: 32 bytes, the canonical encoding (y < p, and no sign bit on x = 0) of a point on the curve, in the prime-order subgroup (LA is the identity), and not the identity itself, which leaves no small-order point.
  • func CheckRedactionTrail(ctx context.Context, store EventStore, signer Signer, deployment string, prior []SignedTreeHead) error: CheckRedactionTrail checks, as RedactJournal does before it appends, that the redaction trail in store is the one the earlier heads attest, and returns ErrRedactTrailUntrusted if it is not. (experimental)
  • func CheckTimestamp(th TreeHead, now time.Time, skew time.Duration) error: CheckTimestamp applies the timestamp rule to one signed head: its TimestampNanos must be positive and not later than now plus skew.
  • func CheckTimestampOrder(earlier, later TreeHead) error: CheckTimestampOrder checks that later, a head that extends earlier, was not signed before it.
  • func ConvergenceLeafName(digest string) string: ConvergenceLeafName is the journal name of the convergence leaf RecordConvergence writes for digest.
  • func ECDSAP256PublicKeyFromSPKI(spki []byte) ([]byte, error): ECDSAP256PublicKeyFromSPKI returns the 65-byte uncompressed SEC1 point (the encoding NewVerifier reads) from a DER SubjectPublicKeyInfo, which is what KMS GetPublicKey and Key Vault return.
  • func ECDSAP256SignatureFromDER(der []byte) ([]byte, error): ECDSAP256SignatureFromDER turns an ASN.1 DER ECDSA-Sig-Value (SEQUENCE { r INTEGER, s INTEGER }, what AWS KMS returns) into the canonical 64-byte low-S r||s.
  • func ECDSAP256SignatureFromRaw(rs []byte) ([]byte, error): ECDSAP256SignatureFromRaw turns a 64-byte r||s signature (what Azure Key Vault and PKCS#11 CKM_ECDSA return) into the canonical form this package verifies: the same r and the low s.
  • func ExecLatencyBound(publishDelay, period, overlap, execAge time.Duration) time.Duration: ExecLatencyBound is the published revocation latency of the execution-time re-check for one CA tier: the longest time from the CA recording a revocation to a gate refusing to execute on it, publishDelay (the time the CA takes to publish a CRL after the revocation; AD CS stamps a revocation at publication, so publish right after revoking) plus period (the CRL or delta period) plus overlap plus execAge.
  • func FormatPublicKey(alg Alg, pub []byte) string: FormatPublicKey returns the text form of a public key that ParsePublicKey reads: the scheme, a colon, and the encoded key in lowercase hex ("ed25519:1a2b...").
  • func GovernedPolicyDigest(result json.RawMessage) (string, error): GovernedPolicyDigest returns the policy digest a governed-action payload (a tool result, as an attested govern.EventTool journals it) carries.
  • func GrantFrom(ctx context.Context) (SignedGrant, Signer, bool): GrantFrom returns the acting signed grant and signer bound to ctx, and whether one was set.
  • func Head(ctx context.Context, store *agent.Journal, runID string) ([]byte, error): Head returns the hash-chain commitment to runID's journal: head_0 = H(domain), and head_i = H(head_{i-1} || stored(record_i)) over the records in persisted order, where stored is the bytes the journal stores for the record (agent.Record.Raw), verbatim.
  • func JournalLeafHash(recordBytes []byte) []byte: JournalLeafHash returns the RFC 6962 leaf hash of a journal record from the bytes the journal stores for it: SHA-256(0x00 || "bide.audit.journal-leaf.v1\x00" || recordBytes).
  • func KeyID(alg string, pub []byte) string: KeyID is the key identity the audit verifiers report from KeyIDs: alg, a colon, and the lowercase hex SHA-256 of the public key's encoding (for Ed25519 the 32-byte key, for ML-DSA its FIPS 204 encoding).
  • func LiftLegalHold(ctx context.Context, trail EventStore, holder agent.Holder, signer Signer, deployment string, prior []SignedTreeHead, id, reason, ticket, executor string, now time.Time, opts ...LiftOption) error: LiftLegalHold lifts the hold id in holder (the store) after recording the lift in the redaction trail: the record comes first, so a hold is never lifted without evidence, and a failure to lift after the record leaves a hold still in force that the audit reports (HOLD_NOT_IN_STORE reads the other way, a hold the trail shows active and the store lacks; this case shows as the store holding a hold the trail shows lifted, HOLD_NOT_IN_TRAIL). (experimental)
  • func NumericAtMost(parent, child string) bool: NumericAtMost is the ScopeRule for an integer upper bound (a limit): the child's value, parsed as a base-10 integer, must be at most the parent's.
  • func PersistEvent(ctx context.Context, evStore EventStore, runID string, seq int, e agent.RunEvent) error: PersistEvent appends one event's canonical leaf to evStore at position seq, for callers streaming events into a store directly; prefer PersistJournal for the crash-safe path.
  • func PersistJournal(ctx context.Context, evStore EventStore, jStore *agent.Journal, runID string) error: PersistJournal mirrors runID's durable event trail into evStore by projecting the journal (agent.ReplayEvents) and appending each canonical event leaf at its position.
  • func PlaceLegalHold(ctx context.Context, trail EventStore, holder agent.Holder, signer Signer, deployment string, prior []SignedTreeHead, h agent.Hold, reason, ticket, executor string, now time.Time) error: PlaceLegalHold places h in holder (the store) and records it in the redaction trail: a record signed with signer (the redaction key) naming the hold, its matter, the runs it covers, the reason, the ticket and who. (experimental)
  • func PlainDistributionPoints(c *x509.Certificate) ([][]string, bool): PlainDistributionPoints returns the URIs of each of c's CRL distribution points that is a plain point: one that holds only a fullName (no reasons, no cRLIssuer, no relative name), in the order the certificate has them, each point's URIs in order.
  • func PoliciesUsed(records []agent.Record) ([]string, error): PoliciesUsed returns the sorted, distinct policy digests exercised by governed actions in the run.
  • func PolicyLeafName(digest string) string: PolicyLeafName is the journal name of the policy leaf RecordPolicy writes for digest.
  • func PolicyUsedKey(r agent.Record) []string: PolicyUsedKey is the KeyFunc of PolicyUsedKeys (see ProveAbsent / ProveAbsentBundle) over governed-action leaves: a completed tool call whose result carries a policy_digest, as an attested govern.EventTool records.
  • func PolicyUsedKeyFor(digest string) string: PolicyUsedKeyFor is the absence key for a specific policy digest: pass it to ProveAbsent / ProveAbsentBundle with PolicyUsedKeys to prove no governed action ran under that policy.
  • func RecordConvergence(ctx context.Context, store *agent.Journal, runID string, cert []byte, digest string) (agent.Record, error): RecordConvergence commits the serialized convergence certificate as a dedicated journal leaf (idempotent per (runID, digest)), so it is covered by the same STH and inclusion proofs as the policy leaf with the same digest and the actions taken under it.
  • func RecordGrant(ctx context.Context, store *agent.Journal, runID string, sg SignedGrant) (agent.Record, error): RecordGrant commits a signed grant as a dedicated journal leaf keyed by its digest (idempotent per (runID, digest)), so it is covered by the same signed tree head and inclusion proofs as the actions taken under it.
  • func RecordPolicy(ctx context.Context, store *agent.Journal, runID string, policy []byte, digest string) (agent.Record, error): RecordPolicy commits the serialized policy as a dedicated journal leaf (idempotent per (runID, digest)), so the policy is covered by the same STH and inclusion proofs as the actions taken under it.
  • func RecordRunCertificate(ctx context.Context, store *agent.Journal, runID string, cert RunCertificate) (agent.Record, error): RecordRunCertificate anchors a RunCertificate as a dedicated journal leaf (idempotent per runID), so the certificate is itself covered by a signed tree head and inclusion proofs, mirroring RecordPolicy / RecordConvergence.
  • func RecordStream(log *EventLog, stream *agent.RunStream, onEvent func(agent.RunEvent)) (*agent.Result, error): RecordStream drains stream through log, committing every event, while forwarding each event to onEvent (nil to skip), then returns the run's Result and error, as RunStream.Result does (the Result is non-nil whenever the run ID is valid, whatever the error, including *ApprovalPending and *OutcomeUnknown).
  • func RedactJournal(ctx context.Context, j *agent.Journal, trail EventStore, plan agent.RedactionPlan, opt RedactionOptions) (agent.RedactionResult, error): RedactJournal erases the records plan names, accountably: it checks the plan can run and that a signed head covers the run, appends a begin record to the redaction trail in trail, runs agent.Redact, and appends an end record, even when the redaction failed partway (its error is in the record). (experimental)
  • func RedactURL(raw string) string: RedactURL removes the userinfo, query and fragment from a URL, so a token in one is never printed.
  • func Root(ctx context.Context, store *agent.Journal, runID string) ([]byte, error): Root returns the RFC 6962 Merkle root committing to runID's journal (records in persisted order, each leaf = the canonical record bytes).
  • func Sign(head []byte, s Signer) ([]byte, error): Sign returns s's signature over a head commitment ("bide.audit.head.v1\x00" || head).
  • func StatusFresh(now, this, next time.Time, maxAge, skew, tolerance time.Duration) bool: StatusFresh is the live freshness test the status rule applies to every CRL, so a refresher's alarm cannot disagree with a gate: a CRL is fresh when now is before nextUpdate, its age is at most maxAge plus the declared thisUpdate skew, and thisUpdate is not beyond the coverage tolerance in the future.
  • func StopPolicyFromDoc(d agent.StopPolicyDoc) (agent.StopPolicy, error): StopPolicyFromDoc builds the stop policy a document names, with this package's verifiers, and validates it. (experimental)
  • func StopVerifierFromAudit(alg agent.Alg, pub []byte) (agent.ApproverVerifier, error): StopVerifierFromAudit builds the verifier of a policy document's approver with this package's verifiers (agent.StopVerifierFunc): pass it to agent.WithStopVerifier, or to agent.PolicyFromDoc. (experimental)
  • func ToolUseKey(r agent.Record) []string: ToolUseKey is the KeyFunc of ToolUseKeys: every record that shows a call ran or may have run, keyed by its ToolUseID.
  • func ToolUseKeyFor(toolUseID string) string: ToolUseKeyFor is the absence key for a tool-use id: pass it to ProveAbsent / ProveAbsentBundle with ToolUseKeys to prove no tool call with that id happened in the run.
  • func UnmarshalStrict(data []byte, v any) error: UnmarshalStrict decodes a JSON proof artifact (a bundle, certificate, evidence package, or tree head) so that what a person reads in the file is exactly what is verified.
  • func VerifyAbsence(root []byte, proof Absence) error: VerifyAbsence returns nil if proof shows Key is absent from the key set committed by root: each named neighbor is included at its index, they bracket Key in sort order, and they are ADJACENT (or Key sits before the first / after the last / the set is empty).
  • func VerifyAnchorInclusion(root []byte, entry AnchorEntry, proof Inclusion) error: VerifyAnchorInclusion returns nil if entry is the leaf at proof.Index in an anchor log of proof.Size entries committed by root, from the entry and proof alone.
  • func VerifyConsistency(firstRoot, laterRoot []byte, proof Consistency) error: VerifyConsistency returns nil if firstRoot (an earlier Root over First records) is an append-only prefix of laterRoot (a Root over Size records), given the proof, checked from the two roots and the proof alone.
  • func VerifyCurrentGrant(sg SignedGrant, ledgerRunID string, p CurrentGrantProof, lastSeen *SignedTreeHead, logV Verifier) error: VerifyCurrentGrant returns nil if sg is the current earned grant of the ledger run ledgerRunID, under logV (the log key, out of band).
  • func VerifyDelegationChain(chain []SignedGrant, issuerVerifier func(issuer string) (Verifier, bool), rules ScopeRules) error: VerifyDelegationChain returns nil if chain, ordered root-first (index 0) to leaf-last, is valid: 1.
  • func VerifyEventInclusion(root []byte, event agent.RunEvent, proof EventInclusion) error: VerifyEventInclusion returns nil if event, under the salt proof discloses, is the leaf at proof.Index in a log of proof.Size events committed by root: from the event and proof alone, no other events needed.
  • func VerifyInclusion(root, recordBytes []byte, proof Inclusion) error: VerifyInclusion returns nil if recordBytes, the bytes a journal stores for a record, are the leaf at proof.Index in a run of proof.Size records committed by root: checked from the bytes and the proof alone, no other records needed, and without decoding the bytes.
  • func VerifySignature(head, sig []byte, v Verifier) error: VerifySignature returns nil if sig is a valid signature of head (see Sign) under v, and an error wrapping ErrNotVerified otherwise.
  • func WithGrant(ctx context.Context, sg SignedGrant, signer Signer) context.Context: WithGrant binds the acting principal's signed grant and its signer to ctx.
  • func WithRollbackGrants(ctx context.Context, signer Signer, grants ...SignedGrant) context.Context: WithRollbackGrants binds grants, with the signer the delegations minted under them signed their child grants with, as further parents a saga rollback accepts for the delegations it walks.

type Absence ​

go
type Absence struct {
	Key   string    `json:"key"`
	Size  int       `json:"size"`
	Left  *Neighbor `json:"left,omitempty"`
	Right *Neighbor `json:"right,omitempty"`
}

Absence is a non-membership proof: Key is not among the Size committed keys, shown by the adjacent committed keys that bracket it.

Constructors and functions

  • func ProveAbsent(records []agent.Record, set KeySet, key string) (Absence, error): ProveAbsent builds an absence proof for key over records in set, or errors if the key is actually present (you cannot prove absence of something that happened) or does not carry the set's prefix (it could never be present, so its absence would say nothing).

type AbsenceBundle ​

go
type AbsenceBundle struct {
	Format  string         `json:"format"`
	RunID   string         `json:"run_id"`
	Absence Absence        `json:"absence"`
	STH     SignedTreeHead `json:"sth"`
}

AbsenceBundle is the portable, anchorable form of an absence proof, mirroring ProofBundle: the proof plus the signed tree head committing the key set it is proven against.

Constructors and functions

  • func ProveAbsentBundle(records []agent.Record, set KeySet, key string, sth SignedTreeHead) (AbsenceBundle, error): ProveAbsentBundle builds an anchorable absence proof bound to sth, a signed key-set head of set (see SignAbsenceRoot).

Methods

  • func (b AbsenceBundle) Verify(v Verifier, set KeySet) error: Verify returns nil if the bundle authentically proves Absence.Key absent from the key set set of run RunID, under v (obtained out of band).

type Alg ​

go
type Alg = agent.Alg

Alg names a signature scheme.

Constants

  • const AlgEd25519 Alg = "ed25519", const AlgMLDSA65 Alg = "ml-dsa-65", const AlgHybrid Alg = "ed25519+ml-dsa-65": The signature schemes.
  • const AlgECDSAP256 Alg = "ecdsa-p256": AlgECDSAP256 is the ECDSA P-256 scheme.

Constructors and functions

  • func CertDecisionKey(leaf *x509.Certificate) (Alg, []byte, error): CertDecisionKey returns the decision scheme of a leaf certificate's public key and the key in the encoding NewVerifier and a signer's PublicKey use, so a command that is about to sign with a key can check, before it signs, that the key is the certificate's.

type Anchor ​

go
type Anchor interface {
	Publish(ctx context.Context, runID string, sth SignedTreeHead) error
}

Anchor is the bring-your-own port for out-of-band anchoring: publish a SignedTreeHead to a trust domain separate from the app (a Certificate-Transparency-style log, a notary / timestamping service, another account's WORM store, a public ledger).

type AnchorEntry ​

go
type AnchorEntry struct {
	Format string         `json:"format"`
	Seq    int            `json:"seq"`
	RunID  string         `json:"run_id"`
	STH    SignedTreeHead `json:"sth"`
}

AnchorEntry is one published commitment recorded by a transparency log: the run it commits to, its signed tree head, and the entry's position in the anchor log.

type ApprovalVerdict ​

go
type ApprovalVerdict struct {
	Need int `json:"need"`

	ToolName string          `json:"tool_name"`
	Args     json.RawMessage `json:"args,omitempty"`

	Counted []string `json:"counted"`

	DeniedBy []string `json:"denied_by,omitempty"`

	Ignored []IgnoredDecision `json:"ignored,omitempty"`

	Times []DecisionTime `json:"times,omitempty"`

	AskedAt string `json:"asked_at,omitempty"`

	Requesters []string `json:"requesters,omitempty"`

	Reask     string `json:"reask,omitempty"`
	ReaskedAt string `json:"reasked_at,omitempty"`

	HeadAt string `json:"head_at,omitempty"`

	Problems []string `json:"problems,omitempty"`

	OK bool `json:"ok"`
}

ApprovalVerdict is the offline result of checking an m-of-n approval gate from evidence.

Constructors and functions

  • func VerifyApprovals(actions []EvidenceAction, toolUseID string, policy agent.ApprovalPolicy, verifierFor agent.ApproverVerifierFor, logV Verifier) (ApprovalVerdict, error): VerifyApprovals checks offline that the m-of-n gate on toolUseID held, trusting only its inputs: actions (ApprovalEvidence's output, alone or inside an EvidencePackage), the policy the auditor expects, verifierFor (each approver's key, the same resolver shape the gate uses at run time), and logV (the log operator's key, obtained out of band).

type ApproverCert ​

go
type ApproverCert struct {
	Leaf  *x509.Certificate
	Chain []*x509.Certificate

	Anchor SPKIHash

	Scheme Alg

	PublicKey []byte

	Identity string

	LeafHash [32]byte

	KeyHash SPKIHash
}

ApproverCert is the result of a successful VerifyChain: what the later steps (the signature, the status, the seat) work from.

Methods

  • func (a *ApproverCert) SeatKeyID() string: SeatKeyID is the agent.ApproverVerifier.KeyIDs entry of a certificate-bound approver: the seat is the canonical identity, so a person with two approver ids, or two certificates, fills one seat.

type AttenuateFunc ​

go
type AttenuateFunc func(parent Grant, subAgent string) Grant

AttenuateFunc derives a child grant from the parent grant and the delegating sub-agent's name.

type AttenuationConfig ​

go
type AttenuationConfig struct {
	Store *agent.Journal

	Narrow AttenuateFunc

	Rules ScopeRules
}

AttenuationConfig configures AttenuatingSubAgent.

type AuditedEventStore ​

go
type AuditedEventStore struct {
	// contains filtered or unexported fields
}

AuditedEventStore wraps an EventStore so every append is continuously anchored, as AuditedStore does for a journal: whenever a trail grows it commits an RFC 6962 Merkle root over the trail's leaves, signs a Signed Tree Head, and publishes it to an Anchor.

Constructors and functions

  • func NewAuditedEventStore(inner EventStore, signer Signer, anchor Anchor) (*AuditedEventStore, error): NewAuditedEventStore wraps inner so each growth of a trail is signed by signer (ed25519, ECDSA, ML-DSA-65, hybrid or an HSM or KMS signer) and published to anchor.

Methods

  • func (a *AuditedEventStore) AnchorTrails(ctx context.Context, trails []string) error: AnchorTrails is the best-effort catch-up the notifier calls on its sweep and recovery pass (agent.NotifyTrailAnchorer): it anchors the named trails, and up to a few more that earlier attempts left unanchored, unless the anchor is in its cooldown, when it only remembers them.
  • func (a *AuditedEventStore) Append(ctx context.Context, trail string, seq int, leaf []byte) error: Append stores leaf in the inner store and returns its result, then has a background publisher publish a head over the trail if it is longer than the last head published.
  • func (a *AuditedEventStore) Flush(ctx context.Context) error: Flush waits until the background publisher has tried every trail appended to before the call (or ctx is done, whose error it returns).
  • func (a *AuditedEventStore) Load(ctx context.Context, trail string) ([][]byte, error): Load reads through to the inner store.
  • func (a *AuditedEventStore) OnError(fn func(trail string, err error)) *AuditedEventStore: OnError sets a hook called when anchoring a write fails: a head could not be built, signed or published, an attempt timed out, or the write's context was done.
  • func (a *AuditedEventStore) OnRecovered(fn func(trail string)) *AuditedEventStore: OnRecovered sets a hook called when a trail's head is published after a streak of failed publishes by the WithMinInterval timer: OnError reports the first failure of a streak only, and this ends it.
  • func (a *AuditedEventStore) Reanchor(ctx context.Context, trail string) error: Reanchor publishes a head over trail now if it holds records no head this store published covers.
  • func (a *AuditedEventStore) ReanchorPending(ctx context.Context) error: ReanchorPending reanchors every trail that a failure, a skipped attempt or a done context left possibly unanchored, one after the other, and stops at the first error.
  • func (a *AuditedEventStore) Unanchored() []string: Unanchored returns, sorted, the trails that may hold records no published head covers: those whose last attempt failed, timed out or was skipped.
  • func (a *AuditedEventStore) Unwrap() EventStore: Unwrap returns the wrapped store, so a decorator above this one, and NotifyTrail, find it and the stores beneath it.
  • func (a *AuditedEventStore) WithClock(now func() int64) *AuditedEventStore: WithClock sets a deterministic timestamp source for the heads (for tests).
  • func (a *AuditedEventStore) WithCooldown(d time.Duration) *AuditedEventStore: WithCooldown sets how long, after a failed publish, writes skip publishing before one probes the anchor again (default DefaultAnchorCooldown).
  • func (a *AuditedEventStore) WithMinInterval(d time.Duration) *AuditedEventStore: WithMinInterval limits how often a trail's head is published: after one head, growth of the same trail is held back until d has passed, and then published as one head that covers all of it.
  • func (a *AuditedEventStore) WithTimeout(d time.Duration) *AuditedEventStore: WithTimeout sets how long one anchoring attempt may take before it is abandoned (default DefaultAnchorTimeout).

type AuditedStore ​

go
type AuditedStore struct {
	// contains filtered or unexported fields
}

AuditedStore wraps a store so every journal write is continuously anchored: whenever a run's journal grows, it commits an RFC 6962 Merkle root over the run, signs a Signed Tree Head, and publishes it to an Anchor (an external transparency log).

Constructors and functions

  • func NewAuditedStore(inner agent.Store, signer Signer, anchor Anchor) (*AuditedStore, error): NewAuditedStore wraps inner so each journal growth is signed by signer (ed25519, ML-DSA-65, or hybrid) and published to anchor.

Methods

  • func (a *AuditedStore) Flush(ctx context.Context) error: Flush publishes now every run whose growth WithMinInterval held back, stopping their timers, and returns the first error (it still tries the others).
  • func (a *AuditedStore) Format(f fmt.State, _ rune): Format writes String for every verb, so no fmt verb prints the signing key.
  • func (a *AuditedStore) Get(ctx context.Context, runID, name string) (agent.Entry, bool, error): Get reads through to the inner store.
  • func (a *AuditedStore) Insert(ctx context.Context, runID, name string, data []byte) (agent.Entry, bool, error): Insert stores the entry in the inner store, then anchors the run's tree head if the journal grew past the last anchored head.
  • func (a *AuditedStore) Load(ctx context.Context, runID string, after int64) iter.Seq2[agent.Entry, error]: Load reads through to the inner store.
  • func (a *AuditedStore) OnError(fn func(runID string, err error)) *AuditedStore: OnError sets a hook called when anchoring a write fails (Publish, or committing the root).
  • func (a *AuditedStore) OnRecovered(fn func(runID string)) *AuditedStore: OnRecovered sets a hook called when a run's head is published after a streak of failed publishes by the WithMinInterval timer: OnError reports the first failure of a streak only, and this ends it.
  • func (a *AuditedStore) Pending() []string: Pending returns, sorted, the runs whose growth WithMinInterval is holding back.
  • func (a *AuditedStore) Reanchor(ctx context.Context, runID string) error: Reanchor anchors runID's journal now, if it holds records no published head covers.
  • func (a *AuditedStore) ReanchorRuns(ctx context.Context, f agent.RunFilter) error: ReanchorRuns is the restart path for WithMinInterval: it anchors now every run f admits whose journal this store has not anchored, which after a start is every run, since the store remembers nothing of an earlier process.
  • func (*AuditedStore) String() string: String returns a description of the store that does not include its signing key.
  • func (a *AuditedStore) Unwrap() agent.Store: Unwrap returns the wrapped store, so agent.Capability finds its optional capabilities (agent.Leaser, agent.Lister) through the wrapper: an AuditedStore has exactly the capabilities of the store it wraps.
  • func (a *AuditedStore) WithClock(now func() int64) *AuditedStore: WithClock sets a deterministic timestamp source (for tests).
  • func (a *AuditedStore) WithMinInterval(d time.Duration) *AuditedStore: WithMinInterval limits how often a run's head is published: after one head, growth of the same run is held back until d has passed, and then published as one head that covers all of it.

type CRL ​

go
type CRL struct {
	Hash       [32]byte
	TBSHash    [32]byte
	Number     *big.Int
	ThisUpdate time.Time
	NextUpdate time.Time
	Delta      bool
	BaseNumber *big.Int

	DistributionPoints []string
	// contains filtered or unexported fields
}

CRL is one CRL as a refresher sees it: what the snapshot holds, or what VerifyCRL returned.

Constructors and functions

  • func VerifyCRL(der []byte, issuer *x509.Certificate, maxEntries int) (*CRL, error): VerifyCRL checks der as a CRL of the given issuing CA: the signature algorithm profile (never SHA-1), the signature against that one certificate, the issuer name, and the structure rules of AddCRL.

Methods

  • func (c *CRL) Serials() []string: Serials returns the decimal serial numbers the CRL lists, sorted.

type CRLInfo ​

go
type CRLInfo struct {
	Hash       [32]byte
	Number     *big.Int
	ThisUpdate time.Time
	NextUpdate time.Time
	Entries    int
}

CRLInfo describes a CRL accepted into a StatusSnapshot.

type CRLSource ​

go
type CRLSource struct {
	URLs []string `json:"urls"`

	DeltaURLs []string `json:"delta_urls"`

	FromPinnedCDP bool `json:"from_pinned_cdp"`
}

CRLSource is where the refresher fetches the CRLs of one issuing CA from.

type CRLSources ​

go
type CRLSources map[SPKIHash]CRLSource

CRLSources maps an issuing CA, by the SHA-256 of its public key, to where its CRLs are fetched.

Constructors and functions

  • func ParseCRLSources(name string, b []byte, readFile func(rel string) ([]byte, error)) (CRLSources, []*x509.Certificate, error): ParseCRLSources reads the refresher members of a certificate policy file: "crl" (the sources, keyed by the lowercase hex SPKI hash of the issuing CA) and "intermediate_certs" (PEM files of the pinned intermediates, relative to the policy file's directory like the anchors).

Methods

  • func (s CRLSources) Validate() error: Validate checks every URL.

type CanonicalConfig ​

go
type CanonicalConfig struct {
	Scheme string

	Host string

	Path *regexp.Regexp
}

CanonicalConfig configures the default canonicalizer (NewCanonicalizer).

type Canonicalizer ​

go
type Canonicalizer interface {
	Name() string

	Version() int

	Canonical(kind IDKind, s string) (string, error)
}

Canonicalizer maps an identifier to its one canonical form.

Constructors and functions

  • func NewCanonicalizer(cfg CanonicalConfig) Canonicalizer: NewCanonicalizer returns the default canonicalizer, "bide.default" version 1.

type CertApprover ​

go
type CertApprover struct {
	ApproverID string

	Policy *CertIdentity

	Heads func(runID string) ([]SignedTreeHead, error)

	LogKey Verifier

	ClockTolerance time.Duration

	Status *StatusSnapshot

	StatusParams StatusParams

	Now func() time.Time

	ExecNow func() time.Time

	RequesterIdentity func(principal string) (identifier string, ok bool)

	ExecStatusAge time.Duration

	ExecStatusAgeFor map[SPKIHash]time.Duration

	CAOverlapFor map[SPKIHash]time.Duration

	PolicyEffectiveFrom time.Time

	StatusArchive StatusArchive

	GoDebug string
}

CertApprover is the verifier of a certificate-bound approver (docs/design/approver-identity.md): it implements agent.CertDecisionVerifier, so the counting rule (agent.TallyApprovals) checks the approver's decisions as certificate-bound ones.

Methods

  • func (*CertApprover) Alg() agent.Alg: Alg reports agent.AlgCertificate: the scheme is the leaf key's, known only from the certificate.
  • func (c *CertApprover) ArchiveStatus(ctx context.Context, hash string, der []byte) error: ArchiveStatus implements agent.StatusArchiver with the verifier's StatusArchive, if any.
  • func (c *CertApprover) CheckCertificate(chain [][]byte, decidedAt, anchoredAt time.Time, mode CheckMode) agent.CertCheck: CheckCertificate is the part of the verifier that needs no journal, signature or signed head: whether the chain is accepted for this approver (CertIdentity.VerifyChain) and what the status rule makes of it, for a decision signed at decidedAt that became provable at anchoredAt, judged by the count rule or the pre-execution rule.
  • func (c *CertApprover) DescribeIdentity() agent.IdentityPolicyRecord: DescribeIdentity implements agent.IdentityDescriber: the certificate policy and status values in force, every one that reaches a verdict, as the identity record keeps them (defaults filled in).
  • func (c *CertApprover) HasIdentity(approverID string) bool: HasIdentity implements agent.IdentityRoster: whether the policy's identity map names the approver id.
  • func (c *CertApprover) Identifier(approverID string) (string, bool): Identifier implements agent.IdentityRoster: the canonical identifier the policy gives the approver id.
  • func (c *CertApprover) IdentityMappingConfigured() bool: IdentityMappingConfigured implements agent.IdentityRoster: whether RequesterIdentity is set.
  • func (c *CertApprover) KeyIDs() []string: KeyIDs is the approver's seat, "ident:" and the canonical identifier the policy's identity map gives the approver id, so two approver ids of one person fill one seat.
  • func (c *CertApprover) PolicyDigest() string: PolicyDigest implements agent.IdentityDescriber: the SHA-256 (lowercase hex) of the JSON of DescribeIdentity, written with encoding/json without HTML escaping, fields in declaration order and map keys sorted, which the pause note and the identity record both carry.
  • func (c *CertApprover) RequesterIdentifier(principal string) (string, bool): RequesterIdentifier implements agent.IdentityRoster: RequesterIdentity if set; else the principal canonicalized as an identifier of the policy's kind, if it is one; else the roster's identifier of the approver id the principal equals.
  • func (c *CertApprover) RosterDigest() string: RosterDigest implements agent.IdentityRoster: the SHA-256 over the whole identity map (bare-key approvers included) in sorted approver order, each entry len32(approver) approver len32(identifier) identifier, so an id or identifier containing '=' or a newline cannot collide with another entry.
  • func (c *CertApprover) ValidateConfig() error: ValidateConfig checks the verifier's configuration when the gate is configured (agent calls it from the approver seat check, at build and on every evaluation): the policy and approver id, the status parameters (StatusParams.Validate), and the rule that the pre-execution status check cannot be fresher than the CA publishes: every CA period, the default and each per-issuer one, is at most half of ExecStatusAge (for the leaf's issuing CA; the per-CA tiers follow with the execution-time check), so the newest CRL available at execution is always fresh enough.
  • func (c *CertApprover) VerifierInfo() (revision, goDebug, buildGoDebug string): VerifierInfo implements agent.IdentityDescriber: the build's vcs.revision, if the binary has one, the x509 GODEBUG settings the operator declares (CertApprover.GoDebug), and the build's baked-in DefaultGODEBUG (the toolchain's go line fixes many x509 behaviours), read from the build info and not from the environment.
  • func (*CertApprover) Verify(message, sig []byte) bool: Verify is always false: a bare signature over bytes, with no certificate, is never a certificate-bound approver's decision.
  • func (c *CertApprover) VerifyCertDecision(cd agent.CertDecision) agent.CertCheck: VerifyCertDecision implements agent.CertDecisionVerifier.
  • func (c *CertApprover) VerifyCertExec(cd agent.CertDecision) agent.CertCheck: VerifyCertExec implements agent.CertExecVerifier: the check a gate runs on a counted decision immediately before the call it authorizes executes.
  • func (c *CertApprover) VerifyCertIntake(cd agent.CertDecision) agent.CertCheck: VerifyCertIntake implements agent.CertIntakeVerifier: the check a decision passes before it is written (agent.WithDecisionCheck, so the approvals intake and bide approve).

type CertError ​

go
type CertError struct {
	Reason string
	Detail string
}

CertError is the failure of VerifyChain.

Methods

  • func (e *CertError) Error() string: Error reports the category and the precise cause.

type CertIdentity ​

go
type CertIdentity struct {
	// contains filtered or unexported fields
}

CertIdentity is a compiled IdentityPolicy: immutable, safe for concurrent use.

Constructors and functions

  • func ParseIdentityPolicy(name string, b []byte, readAnchor func(rel string) ([]byte, error)) (*CertIdentity, error): ParseIdentityPolicy compiles a certificate policy file's bytes (see identityPolicyFile for its members).

Methods

  • func (c *CertIdentity) AllowsEmailProtectionEKU() bool: AllowsEmailProtectionEKU reports whether the policy accepts id-kp-emailProtection in place of EKU.
  • func (c *CertIdentity) ApproverIDs() []string: ApproverIDs returns the approver ids of the policy's identity map, sorted.
  • func (c *CertIdentity) Canonicalizer() Canonicalizer: Canonicalizer returns the function this policy compares identifiers with, for the identity record and for the other places an identity is compared (the requester principal).
  • func (c *CertIdentity) DistrustFrom(k SPKIHash) time.Time: DistrustFrom returns when the policy ends trust in the key (zero when it does not).
  • func (c *CertIdentity) EKU() asn1.ObjectIdentifier: EKU returns the extended key usage a leaf must carry, as a copy.
  • func (c *CertIdentity) EvaluateStatus(ac *ApproverCert, a time.Time, s *StatusSnapshot, p StatusParams) ChainStatus: EvaluateStatus applies the status rule to every non-anchor certificate of ac's chain at A(d) = a, over the CRLs in s.
  • func (c *CertIdentity) IDKind() IDKind: IDKind returns the kind of the one subject alternative name a leaf must carry.
  • func (c *CertIdentity) Identity(approverID string) (string, bool): Identity returns the canonical identifier the policy expects for an approver id.
  • func (c *CertIdentity) IsPinnedIntermediate(k SPKIHash) bool: IsPinnedIntermediate reports whether the key is a pinned intermediate.
  • func (c *CertIdentity) IsTrustAnchor(k SPKIHash) bool: IsTrustAnchor reports whether the key is one of the policy's trust anchors.
  • func (c *CertIdentity) MaxLeafLifetime() time.Duration: MaxLeafLifetime returns the bound on a leaf's notAfter minus notBefore: the policy's value, or the 24 hour default when it set none.
  • func (c *CertIdentity) PinnedIntermediates() []SPKIHash: PinnedIntermediates returns the pinned intermediate keys, sorted.
  • func (c *CertIdentity) PolicyOID() x509.OID: PolicyOID returns the certificate policy OID a leaf must assert.
  • func (c *CertIdentity) TrustAnchors() []*x509.Certificate: TrustAnchors returns the policy's trust anchor certificates, ordered by key.
  • func (c *CertIdentity) TrustRoots() *x509.CertPool: TrustRoots returns the policy's trust anchors as a certificate pool.
  • func (c *CertIdentity) VerifyChain(approverID string, chain [][]byte, decidedAt, anchoredAt time.Time) (*ApproverCert, error): VerifyChain checks a decision's certificate chain for approver approverID.

type CertStatus ​

go
type CertStatus struct {
	Serial *big.Int

	Revoked    bool
	E          time.Time
	ReasonCode int
	Compromise bool
	RevokedBy  [32]byte

	Tier StatusTier

	S, LC     time.Time
	LCKnown   bool
	Unbounded bool

	Stale bool

	Window time.Duration

	Used [][32]byte

	Note string

	Caveat string

	PolicyRefusal bool

	Basis string

	Warning string

	EvictionGap bool
}

CertStatus is the status finding for one certificate of a chain.

Methods

  • func (c CertStatus) IsFinal() bool: IsFinal reports whether the finding is a verified one: not revoked, and final under the status rule.

type ChainStatus ​

go
type ChainStatus struct {
	Certs   []CertStatus
	Revoked bool
	Tier    StatusTier
}

ChainStatus is the finding for every non-anchor certificate of an accepted chain, leaf first.

Methods

  • func (cs ChainStatus) Err() error: Err is nil when the chain has usable status and no revocation (a provisional or live-count finding included: check IsFinal before calling a decision verified).
  • func (cs ChainStatus) IsFinal() bool: IsFinal reports whether every certificate of the chain is final and none is revoked.

type CheckMode ​

go
type CheckMode int

CheckMode is the counting rule a CheckCertificate verdict is judged by.

Constants

  • const CheckCount CheckMode: CheckCount judges as the gate does when it counts a decision: status no older than MaxStatusAge (and MaxStatusAgeFor).
  • const CheckExec CheckMode: CheckExec judges as the gate does immediately before the call runs: ExecStatusAge for the leaf's issuing CA and ExecStatusAgeFor for each CA tier above it.

type Consistency ​

go
type Consistency struct {
	First int      `json:"first"`
	Size  int      `json:"size"`
	Path  [][]byte `json:"path"`
}

Consistency is an RFC 6962 consistency proof: the first First records are an append-only prefix of the Size-record tree.

Constructors and functions

  • func ProveConsistency(ctx context.Context, store *agent.Journal, runID string, first int) (Consistency, error): ProveConsistency proves that runID's first first records are an append-only prefix of its current journal, i.e. nothing before first was changed or reordered, only appended.

type ConvergenceContent ​

go
type ConvergenceContent struct {
	Digest      string          `json:"digest"`
	Certificate json.RawMessage `json:"certificate"`
}

ConvergenceContent is the payload of a convergence leaf: an opaque, serialized convergence certificate and the policy digest it certifies.

type CoverageBound ​

go
type CoverageBound struct {
	MaxRecords int

	MaxAge    time.Duration
	Now       time.Time
	Tolerance time.Duration
}

CoverageBound is how long a recorded decision may stay outside every signed tree head before CheckDecisionCoverage reports it overdue.

type CoverageReport ​

go
type CoverageReport struct {
	RunID          string             `json:"run_id"`
	Records        int                `json:"records"`
	Heads          int                `json:"heads"`
	LargestHead    int                `json:"largest_head"`
	Decisions      []DecisionCoverage `json:"decisions"`
	RejectedHeads  []RejectedHead     `json:"rejected_heads,omitempty"`
	DivergentHeads []DivergentHead    `json:"divergent_heads,omitempty"`

	NoCountedHeads bool `json:"no_counted_heads,omitempty"`
	// contains filtered or unexported fields
}

CoverageReport is CheckDecisionCoverage's result.

Constructors and functions

  • func CheckDecisionCoverage(runID string, recs []agent.Record, heads []SignedTreeHead, v Verifier, bound CoverageBound) (CoverageReport, error): CheckDecisionCoverage reports, for each approval decision in recs (runID's journal, in order), whether a signed tree head covers it, and flags the ones no head has covered for longer than bound.

Methods

  • func (r CoverageReport) OK() bool: OK reports whether no decision is overdue and no signed head diverges from the journal given.

type CurrentGrantProof ​

go
type CurrentGrantProof struct {
	Format      string      `json:"format"`
	Leaf        ProofBundle `json:"leaf"`
	Consistency Consistency `json:"consistency"`
}

CurrentGrantProof proves which earned grant is current in a ledger: Leaf proves the grant is the last leaf of a signed ledger head, and Consistency proves that head is an append-only extension of the head the verifier saw last, so a verifier that remembers its last-seen head cannot be shown an older head as current.

Constructors and functions

  • func ProveCurrentGrant(ctx context.Context, ledger *agent.Journal, ledgerRunID string, sth SignedTreeHead, lastSeenSize int) (CurrentGrantProof, error): ProveCurrentGrant proves which earned grant is current in the ledger at the signed ledger head sth: an inclusion proof of the ledger's last leaf (index sth.Size-1), plus a consistency proof from lastSeenSize (the size of the ledger head the verifier saw last, 0 if none) to sth.Size.

type DecisionCoverage ​

go
type DecisionCoverage struct {
	Step       string `json:"step"`
	Approver   string `json:"approver,omitempty"`
	Index      int    `json:"index"`
	RecordedAt string `json:"recorded_at,omitempty"`
	Status     string `json:"status"`

	Basis string `json:"basis,omitempty"`

	CoveredBySize int `json:"covered_by_size,omitempty"`

	Behind int `json:"behind"`

	Note string `json:"note,omitempty"`
}

DecisionCoverage is one recorded decision and the signed head, if any, that covers it.

type DecisionReceipt ​

go
type DecisionReceipt struct {
	Format    string          `json:"format"`
	RunID     string          `json:"run_id"`
	ToolUseID string          `json:"tool_use_id"`
	ToolName  string          `json:"tool_name"`
	Args      json.RawMessage `json:"args"`
	ArgsSHA   string          `json:"args_sha256"`
	Approver  string          `json:"approver"`
	Approved  bool            `json:"approved"`
	DecidedAt string          `json:"decided_at"`
	Alg       Alg             `json:"alg"`
	Signature []byte          `json:"signature"`

	Cert [][]byte `json:"cert,omitempty"`

	Record     string `json:"record"`
	Index      int    `json:"index"`
	RecordedAt string `json:"recorded_at"`

	LeafHash string `json:"leaf_hash"`

	Anchor *ProofBundle `json:"anchor,omitempty"`
}

DecisionReceipt is one signed approver decision, with the journal record that holds it.

Constructors and functions

  • func AnchorReceipt(r DecisionReceipt, journal []agent.Record, heads []SignedTreeHead, logKey Verifier) (DecisionReceipt, error): AnchorReceipt returns r with its anchoring proof: the inclusion of the decision's record under the smallest signed head of heads that reaches its position and matches journal.
  • func NewDecisionReceipt(s agent.ApprovalSubject, d agent.Decision, rec agent.Record, index int) (DecisionReceipt, error): NewDecisionReceipt returns the receipt of decision d on call s, held by the journal record rec at position index of the run's journal.

Methods

  • func (r DecisionReceipt) AnchorTime(logKey Verifier) (time.Time, error): AnchorTime is the timestamp of the signed head the receipt's proof carries, as logKey vouches for it.
  • func (r DecisionReceipt) Verify(v Verifier) error: Verify checks the receipt on its own: it is of ReceiptFormat, its arguments hash to ArgsSHA, and Signature is a valid signature, by the approver's key v, over the decision bytes (agent.ApprovalDecisionBytes) of exactly this run, call, tool, arguments, approver, decision and time.
  • func (r DecisionReceipt) VerifyCertificate(ci *CertIdentity, logKey Verifier) error: VerifyCertificate checks a certificate-bound receipt against the gate's certificate policy: the chain it carries is accepted for r.Approver at a, the time of the head the receipt's anchoring proof carries as logKey vouches for it (see AnchorTime; a receipt with no proof fails, and the caller cannot choose the time), by exactly the rules CertIdentity.VerifyChain applies to a decision the gate counts; the receipt's scheme is the one the leaf's key has; and the signature verifies under that key over the v4 bytes.
  • func (r DecisionReceipt) VerifyIdentity(ci *CertIdentity, logKey Verifier) (ReceiptIdentity, error): VerifyIdentity checks a certificate-bound receipt on its own: the anchoring proof holds under logKey and fixes A (AnchorTime), and the chain, the identity and the signature are accepted by ci at A (VerifyCertificate).

type DecisionTime ​

go
type DecisionTime struct {
	Approver   string   `json:"approver"`
	Step       string   `json:"step"`
	DecidedAt  string   `json:"decided_at"`
	RecordedAt string   `json:"recorded_at,omitempty"`
	Flags      []string `json:"flags,omitempty"`
}

DecisionTime is the two times of one counted approver decision, kept apart on purpose:

Constructors and functions

  • func CheckDecisionTimes(times []DecisionTime, c TimeCheck) []DecisionTime: CheckDecisionTimes returns times, in journal order, with Flags recomputed: FlagDecisionTimes' flags under c.AskedAt and c.Tolerance, and, for a canonical RecordedAt, FlagRecordedOutOfOrder when it is more than the tolerance before an earlier decision's RecordedAt or before c.AskedAt, and FlagRecordedAfterHead when it is more than the tolerance after c.HeadAt.
  • func FlagDecisionTimes(times []DecisionTime, askedAt string, tolerance time.Duration) []DecisionTime: FlagDecisionTimes returns times with Flags recomputed under tolerance: FlagDecidedAfterRecorded when a decision's DecidedAt is more than tolerance after its RecordedAt (FlagRecordedAtInvalid in its place when RecordedAt is missing or not a canonical time), and FlagDecidedBeforeAsked when its DecidedAt is before askedAt, the time the run asked for approval (ApprovalVerdict.AskedAt), and FlagAskedUnknown in its place when askedAt is "" or not a canonical time.

Methods

  • func (d DecisionTime) Gap() (gap time.Duration, ok bool): Gap returns RecordedAt minus DecidedAt: how long after the approver's signed time bide recorded the decision (negative when the signed time is later).

type DivergentHead ​

go
type DivergentHead struct {
	Size   int    `json:"size"`
	Reason string `json:"reason"`
}

DivergentHead is a head the log key signed for this run that does not match the journal given: the journal is shorter than the head (a stale or truncated export), or its first Size records are not what the head signed (an export, or a journal, that differs from what was signed).

type ECDSAP256Signer ​

go
type ECDSAP256Signer struct {
	Priv *ecdsa.PrivateKey
}

ECDSAP256Signer signs with an ECDSA P-256 private key.

Methods

  • func (ECDSAP256Signer) Alg() Alg: Alg reports the signature scheme (AlgECDSAP256).
  • func (s ECDSAP256Signer) PublicKey() []byte: PublicKey returns the 65-byte uncompressed SEC1 public key, or nil if there is no key or it is not on P-256.
  • func (s ECDSAP256Signer) Sign(m []byte) ([]byte, error): Sign returns the 64-byte low-S r||s signature over SHA-256(m), or an error if the key is unusable.

type ECDSAP256Verifier ​

go
type ECDSAP256Verifier struct {
	Pub *ecdsa.PublicKey
}

ECDSAP256Verifier verifies with an ECDSA P-256 public key.

Methods

  • func (ECDSAP256Verifier) Alg() Alg: Alg reports the signature scheme (AlgECDSAP256).
  • func (v ECDSAP256Verifier) KeyIDs() []string: KeyIDs identifies the public key, for agent.ApproverVerifier: one entry, KeyID(AlgECDSAP256, the 65-byte point).
  • func (v ECDSAP256Verifier) PublicKey() []byte: PublicKey returns the 65-byte uncompressed SEC1 public key, or nil if there is none or it is not a P-256 point.
  • func (v ECDSAP256Verifier) Verify(m, sig []byte) bool: Verify reports whether sig is a canonical (64-byte, 1 <= r < n, 1 <= s <= (n-1)/2) ECDSA P-256 signature over SHA-256(m).

type EarnedAuthority ​

go
type EarnedAuthority struct {
	// contains filtered or unexported fields
}

EarnedAuthority is a control loop that adjusts an agent's delegated limit from its provable track record.

Constructors and functions

  • func NewEarnedAuthority(ctx context.Context, ladder []int, promoteEvery int, root SignedGrant, signer Signer, subject string, ledger *agent.Journal, ledgerRunID string) (*EarnedAuthority, error): NewEarnedAuthority builds a controller for subject, granting the limits in ladder (rung 0 is the baseline) and promoting one rung every promoteEvery compliant actions.

Methods

  • func (e *EarnedAuthority) FlagAnomaly(ctx context.Context) (changed bool, err error): FlagAnomaly resets authority to the baseline rung immediately, returning whether it changed.
  • func (e *EarnedAuthority) Grant() SignedGrant: Grant returns the current signed earned grant (a child of root, scope limit = the current rung).
  • func (e *EarnedAuthority) Limit() int: Limit returns the currently earned limit.
  • func (e *EarnedAuthority) RecordCompliant(ctx context.Context) (promoted bool, err error): RecordCompliant notes one clean governed action; it promotes one rung when the streak reaches the threshold (unless already at the top), returning whether a promotion happened.
  • func (e *EarnedAuthority) Tier() int: Tier returns the current rung (0 is baseline).

type Ed25519Signer ​

go
type Ed25519Signer struct {
	Priv ed25519.PrivateKey
}

Ed25519Signer signs with an Ed25519 private key.

Methods

  • func (Ed25519Signer) Alg() Alg: Alg reports the signature scheme (AlgEd25519).
  • func (s Ed25519Signer) Format(f fmt.State, _ rune): Format writes String for every verb, so no fmt verb prints the key.
  • func (Ed25519Signer) GobEncode() ([]byte, error): GobEncode refuses: the signer holds a private key.
  • func (Ed25519Signer) MarshalJSON() ([]byte, error): MarshalJSON refuses: the signer holds a private key.
  • func (s Ed25519Signer) PublicKey() []byte: PublicKey returns the 32-byte Ed25519 public key, or nil if the private key has the wrong length.
  • func (s Ed25519Signer) Sign(m []byte) ([]byte, error): Sign returns the Ed25519 signature over m, or an error if the private key has the wrong length.
  • func (Ed25519Signer) String() string: String returns a description of the signer that does not include the key.

type Ed25519Verifier ​

go
type Ed25519Verifier struct {
	Pub ed25519.PublicKey
}

Ed25519Verifier verifies with an Ed25519 public key.

Methods

  • func (Ed25519Verifier) Alg() Alg: Alg reports the signature scheme (AlgEd25519).
  • func (v Ed25519Verifier) KeyIDs() []string: KeyIDs identifies the public key, for agent.ApproverVerifier: one entry, KeyID(AlgEd25519, Pub).
  • func (v Ed25519Verifier) PublicKey() []byte: PublicKey returns the public key, or nil if it has the wrong length.
  • func (v Ed25519Verifier) Verify(m, sig []byte) bool: Verify reports whether sig is a valid Ed25519 signature over m.

type ErasedEnd ​

go
type ErasedEnd struct {
	RunID string `json:"run_id"`

	Marker string `json:"marker"`

	Kind string `json:"kind"`
}

ErasedEnd is a run whose end marker was erased, with how it ended per the signed redaction trail. (experimental)

type EventInclusion ​

go
type EventInclusion struct {
	Format string `json:"format"`
	Salt   []byte `json:"salt"`
	Inclusion
}

EventInclusion is an inclusion proof for one event: the event's own salt, which its leaf commits to, and the RFC 6962 audit path (the same Inclusion journal proofs use) from that leaf to the log's Root.

type EventLog ​

go
type EventLog struct {
	// contains filtered or unexported fields
}

EventLog is an append-only, tamper-evident log of one run's RunEvents.

Constructors and functions

  • func EventLogFromJournal(ctx context.Context, store *agent.Journal, runID string) (*EventLog, error): EventLogFromJournal builds an EventLog from runID's DURABLE journal by projecting it to the semantic events Agent.Stream re-emits on resume (agent.ReplayEvents).
  • func LoadEventLog(ctx context.Context, evStore EventStore, runID string) (*EventLog, error): LoadEventLog rebuilds an EventLog from evStore's persisted leaves for runID, ready for Root / Head / TreeHead / Prove / ProveConsistency, from the store alone, no journal needed.
  • func NewEventLog() *EventLog: NewEventLog returns an empty log.

Methods

  • func (l *EventLog) Add(e agent.RunEvent) error: Add appends one event as a canonical, kind-tagged leaf that commits to a fresh random salt (agent.SaltSize bytes from crypto/rand; see EventInclusion).
  • func (l *EventLog) Head() []byte: Head is the linear SHA-256 hash-chain commitment over the events (domain-separated), the event-stream analogue of audit.Head: head_0 = H(eventDomain), head_i = H(head_{i-1} || canonical(event_i)).
  • func (l *EventLog) Len() int: Len is the number of events committed so far.
  • func (l *EventLog) Prove(index int) (EventInclusion, error): Prove returns an inclusion proof for the event at index against Root: enough to verify that one event WITHOUT revealing any other (selective disclosure over the event stream).
  • func (l *EventLog) ProveConsistency(first int) (Consistency, error): ProveConsistency proves the first first events are an append-only PREFIX of the current log, nothing observed earlier was rewritten or reordered, only appended.
  • func (l *EventLog) Root() []byte: Root is the RFC 6962 Merkle root over every event added so far (empty-log root = SHA-256(); identical shape to audit.Root over the journal).
  • func (l *EventLog) TreeHead(runID string, timestamp int64) TreeHead: TreeHead returns a commitment to runID's events added so far at the given timestamp, the EventLog analogue of NewTreeHead over the journal.

type EventStore ​

go
type EventStore interface {
	Append(ctx context.Context, runID string, seq int, leaf []byte) error

	Load(ctx context.Context, runID string) ([][]byte, error)
}

EventStore is the bring-your-own port: append canonical event leaves to your append-only backend (a Postgres table with UNIQUE(run_id, seq) and insert-only grants, object storage with object-lock/WORM, or a log) and read them back.

type EvidenceAction ​

go
type EvidenceAction struct {
	Label string `json:"label"`

	Kind EvidenceKind `json:"kind"`

	Ref string `json:"ref,omitempty"`

	Bundle ProofBundle `json:"bundle"`
}

EvidenceAction is one proven action inside an EvidencePackage: a ProofBundle plus the label, kind, and reference the report names it by.

Constructors and functions

  • func ApprovalEvidence(ctx context.Context, store *agent.Journal, runID, toolUseID string, sth SignedTreeHead) ([]EvidenceAction, error): ApprovalEvidence builds the complete evidence for an m-of-n gated call under one STH, in this order: for a gate whose tally excluded the requester (agent.ApprovalTally.ExcludePrincipal), the run's run:principal record (Kind "step", Ref "run:principal"; agent.RunPrincipal), which names the requesters and nothing of the run's input; the model turn that requested the call (Kind "call"), the record that the run paused at the gate (agent.ApprovalWait, Kind "step", when the journal holds one: it carries when approvers were asked), every decision record the gate read (Kind "approval", from the journaled tally's Records, in journal order), the gate's terminal tally (Kind "approval-tally"), and the call's result (Kind "tool", labelled by its tool-use id as every tool action is).

type EvidenceConsistency ​

go
type EvidenceConsistency struct {
	From SignedTreeHead `json:"from"`

	Proof Consistency `json:"proof"`
}

EvidenceConsistency proves the journal only grew between two signed heads of one run: From, an earlier head (typically taken from the anchor log), and the package STH.

type EvidenceGrants ​

go
type EvidenceGrants struct {
	Chain []SignedGrant `json:"chain"`

	Anchored []EvidenceAction `json:"anchored"`
}

EvidenceGrants carries the run's authority: the delegation chain as signed grants (root-first) and, per grant, a ProofBundle proving the grant leaf is anchored in the same signed log as the actions.

type EvidenceItem ​

go
type EvidenceItem struct {
	Kind     EvidenceKind `json:"kind"`
	Label    string       `json:"label"`
	Ref      string       `json:"ref,omitempty"`
	Verified bool         `json:"verified"`
	Note     string       `json:"note"`
}

EvidenceItem is one line of an EvidenceReport: what was checked, whether it verified, and a short human note (the reason on failure, or a one-line description on success).

type EvidenceKind ​

go
type EvidenceKind string

EvidenceKind names what one item of an EvidencePackage proves.

Constants

  • const KindCall EvidenceKind = "call", const KindApproval EvidenceKind = "approval", const KindApprovalTally EvidenceKind = "approval-tally", const KindTool EvidenceKind = "tool": Evidence kinds for an m-of-n approval, in the order ApprovalEvidence emits them.
  • const KindStep EvidenceKind = "step", const KindGrant EvidenceKind = "grant", const KindRunCertificate EvidenceKind = "run-certificate", const KindConsistency EvidenceKind = "consistency": Other evidence kinds.

type EvidenceOption ​

go
type EvidenceOption func(*evidenceOptions)

An EvidenceOption selects what an EvidencePackage includes.

Constructors and functions

  • func WithAllToolCalls() EvidenceOption: WithAllToolCalls proves every completed tool call in the run, enumerated from its history.
  • func WithConsistencyFrom(earlier SignedTreeHead) EvidenceOption: WithConsistencyFrom includes an append-only consistency proof from earlier, a signed journal head of the same run taken before this package (for instance the last head an auditor saw in the anchor log), to the package's STH: nothing earlier than earlier.Size was rewritten or reordered.
  • func WithGrants() EvidenceOption: WithGrants includes the run's authority: every anchored grant leaf, proven included in the signed log, plus the signed grants themselves as the delegation chain (in journal order, root-first for a well-formed attenuation chain).
  • func WithLabel(label string) EvidenceOption: WithLabel sets a human-readable description of what the evidence establishes.
  • func WithRunCertificate(spec RunCertSpec) EvidenceOption: WithRunCertificate includes the proof-carrying run certificate for the whole run, certified against spec.ApprovedPolicies.
  • func WithStep(name string) EvidenceOption: WithStep adds a proof that the durable step with this name (a Step / Parallel task) happened.
  • func WithToolCall(toolUseID string) EvidenceOption: WithToolCall adds a proof that the completed tool call with this tool-use id happened in the run.

type EvidencePackage ​

go
type EvidencePackage struct {
	Format string `json:"format"`

	RunID string `json:"run_id"`

	Label string `json:"label,omitempty"`

	Alg       Alg    `json:"alg"`
	PublicKey []byte `json:"public_key"`

	STH SignedTreeHead `json:"sth"`

	Actions []EvidenceAction `json:"actions"`

	Grants *EvidenceGrants `json:"grants,omitempty"`

	RunCertificate *RunCertificate `json:"run_certificate,omitempty"`

	Consistency *EvidenceConsistency `json:"consistency,omitempty"`

	Signature []byte `json:"signature"`
}

An EvidencePackage is the portable, offline-verifiable evidence artifact for one run: a single self-contained bundle that PACKAGES a run's already-produced cryptographic proofs (a signed tree head, per-action inclusion proofs, and optionally the run certificate, the authority grant chain, and an append-only consistency proof) into one JSON document you can store, email, or hand to an auditor.

Constructors and functions

  • func Evidence(ctx context.Context, store *agent.Journal, runID string, s Signer, timestamp int64, opts ...EvidenceOption) (EvidencePackage, error): Evidence assembles and seals the portable, offline-verifiable EvidencePackage for runID.

Methods

  • func (e *EvidencePackage) Seal(s Signer) error: Seal signs the package with s, the log key that signed its STH.
  • func (e EvidencePackage) Verify(v Verifier, opts ...EvidenceVerifyOption) (EvidenceReport, error): Verify re-checks every proof in the package against v, a verifier for the log key obtained OUT OF BAND (the anchor / transparency log), entirely offline.

type EvidenceReport ​

go
type EvidenceReport struct {
	OK bool `json:"ok"`

	RunID string `json:"run_id"`

	Label string `json:"label,omitempty"`

	STHVerified bool `json:"sth_verified"`

	Problems []string `json:"problems,omitempty"`

	Items []EvidenceItem `json:"items"`
}

EvidenceReport is the structured outcome of EvidencePackage.Verify: an overall verdict plus a per-item verdict list, so a caller (or the CLI) can print exactly which proven item held and which did not.

type EvidenceVerifyOption ​

go
type EvidenceVerifyOption func(*evidenceVerifyOptions)

EvidenceVerifyOption supplies what the auditor, not the package, decides.

Constructors and functions

  • func WithApprovedPolicies(digests ...string) EvidenceVerifyOption: WithApprovedPolicies is the auditor's approved-policy allowlist, against which a package's run certificate is checked.
  • func WithClockSkew(d time.Duration) EvidenceVerifyOption: WithClockSkew sets how far past the verifier's clock a signed head's timestamp may be (DefaultClockSkew by default).
  • func WithVerifyTime(now time.Time) EvidenceVerifyOption: WithVerifyTime sets the clock EvidencePackage.Verify checks timestamps against (time.Now by default), so a package can be checked as of a given moment.

type Grant ​

go
type Grant struct {
	ID      string            `json:"id"`
	Issuer  string            `json:"issuer"`
	Subject string            `json:"subject"`
	Scope   map[string]string `json:"scope,omitempty"`

	NotAfterUnix int64  `json:"not_after_unix,omitempty"`
	ParentRef    string `json:"parent_ref,omitempty"`
}

Grant is a signed statement by a principal (Issuer) authorizing an actor (Subject) to act within Scope until NotAfterUnix.

Methods

  • func (g Grant) Bytes() []byte: Bytes is the canonical serialization that is signed and digested: "bide.audit.grant.v2\n" followed by the grant's JSON.
  • func (g Grant) Digest() string: Digest is a stable SHA-256 over the grant's canonical bytes (Bytes), used as agent.Identity.AuthorityRef and as the anchoring key.
  • func (g Grant) Expired(nowUnix int64) bool: Expired reports whether the grant is past NotAfterUnix at nowUnix (Unix seconds).

type HybridSigner ​

go
type HybridSigner struct {
	Ed Ed25519Signer
	ML MLDSASigner
}

HybridSigner signs with both schemes; the signature is only accepted if BOTH verify, so the anchor is safe as long as either scheme remains unbroken.

Methods

  • func (HybridSigner) Alg() Alg: Alg reports the signature scheme (AlgHybrid).
  • func (s HybridSigner) Format(f fmt.State, _ rune): Format writes String for every verb, so no fmt verb prints either key.
  • func (s HybridSigner) PublicKey() []byte: PublicKey returns the hybrid public key: a 4-byte big-endian length of the Ed25519 key, the Ed25519 key, then the ML-DSA-65 key.
  • func (s HybridSigner) Sign(m []byte) ([]byte, error): Sign returns the packed pair of domain-separated Ed25519 and ML-DSA-65 signatures over m.
  • func (HybridSigner) String() string: String returns a description of the signer that does not include either key.

type HybridVerifier ​

go
type HybridVerifier struct {
	Ed Ed25519Verifier
	ML MLDSAVerifier
}

HybridVerifier requires both component signatures to verify, each over its own label and the message.

Methods

  • func (HybridVerifier) Alg() Alg: Alg reports the signature scheme (AlgHybrid).
  • func (v HybridVerifier) KeyIDs() []string: KeyIDs identifies both component keys, for agent.ApproverVerifier: the Ed25519 entry, then the ML-DSA-65 entry.
  • func (v HybridVerifier) PublicKey() []byte: PublicKey returns the hybrid public key (see HybridSigner.PublicKey), or nil if either component has no usable key.
  • func (v HybridVerifier) Verify(m, sig []byte) bool: Verify reports whether both component signatures over m are valid.

type IDKind ​

go
type IDKind string

IDKind names the kind of identifier that is an approver's seat.

Constants

  • const IDPersonURI IDKind = "person-uri": IDPersonURI is an opaque person id in a URI subject alternative name that has a host ("https://idp.bank.example/person/8f3a..."), a stable directory key and not a name.
  • const IDEmail IDKind = "email": IDEmail is an rfc822Name.

type IdentityPolicy ​

go
type IdentityPolicy struct {
	Anchors []*x509.Certificate

	Inter []SPKIHash

	Distrust map[SPKIHash]time.Time

	Identity map[string]string

	IDKind IDKind

	EKU asn1.ObjectIdentifier

	AllowEmailProtectionEKU bool

	Policy x509.OID

	Canonical Canonicalizer

	MaxChain int

	Skew time.Duration

	AnchorGrace time.Duration

	RSA2048Until time.Time

	MaxLeafLifetime time.Duration

	NotBeforeBackdate      time.Duration
	RequireNameConstraints bool

	RequirePolicyOnCAs bool
}

IdentityPolicy is the certificate rules of one gate.

Methods

  • func (p IdentityPolicy) Compile() (*CertIdentity, error): Compile validates the policy and fixes a copy of it.

type IgnoredDecision ​

go
type IgnoredDecision struct {
	Approver string `json:"approver"`
	Step     string `json:"step"`
	Reason   string `json:"reason"`
}

IgnoredDecision is one disclosed approver decision that did not count toward the gate.

type Inclusion ​

go
type Inclusion struct {
	Index int      `json:"index"`
	Size  int      `json:"size"`
	Path  [][]byte `json:"path"`
}

Inclusion is an RFC 6962 audit path proving one record's membership in a committed run.

Constructors and functions

  • func Prove(ctx context.Context, store *agent.Journal, runID string, index int) (Inclusion, error): Prove returns an inclusion proof for the record at index in runID's journal: enough to verify that record's stored bytes (agent.Record.Raw) against Root WITHOUT revealing any other record (selective disclosure).

type JournalExport ​

go
type JournalExport struct {
	Format  string   `json:"format"`
	RunID   string   `json:"run_id"`
	Records [][]byte `json:"records"`
}

A JournalExport is a run's journal as the bytes the journal stores for each record, in persisted order: the input a prover that holds no store (bide audit prove and prove-absent) builds proofs from.

Constructors and functions

  • func ExportJournal(ctx context.Context, store *agent.Journal, runID string) (JournalExport, error): ExportJournal returns runID's journal as a JournalExport.

Methods

  • func (x JournalExport) Journal() ([]agent.Record, error): Journal decodes the exported records, each keeping its stored bytes as its Raw, so the proof builders commit to the bytes exported.

type KeyFunc ​

go
type KeyFunc func(agent.Record) []string

KeyFunc extracts the absence keys a record adds to a key set: none (nil) to exclude the record, or one or more (a model turn that requests several tool calls adds one key per call).

type KeySet ​

go
type KeySet struct {
	Kind   string
	Prefix string
	Key    KeyFunc
}

KeySet names one absence key set: the tree Kind its signed heads commit to, the Prefix every key it yields starts with, and the KeyFunc that projects a journal onto it.

Constructors and functions

  • func KeySetForKey(key string) (KeySet, bool): KeySetForKey returns the built-in key set a key belongs to, by its prefix.

type LiftAuthorization ​

go
type LiftAuthorization struct {
	Format string `json:"format"`
	Kind   string `json:"kind"`

	Deployment string `json:"deployment"`

	HoldID     string   `json:"hold_id"`
	HoldMatter string   `json:"hold_matter"`
	HoldRuns   []string `json:"hold_runs"`
	HoldTree   bool     `json:"hold_tree,omitempty"`

	PlacedPosition int    `json:"placed_position"`
	PlacedLeaf     string `json:"placed_leaf"`
	TrailSize      int    `json:"trail_size"`
	Reason         string `json:"reason"`
	Ticket         string `json:"ticket"`

	LifterKeyID    string `json:"lifter_key_id,omitempty"`
	AuthorizedAtMs int64  `json:"authorized_at_ms"`
	NotAfterMs     int64  `json:"not_after_ms"`

	Alg       string `json:"alg"`
	PublicKey []byte `json:"public_key"`
	KeyID     string `json:"key_id"`
	Signature []byte `json:"signature"`
}

A LiftAuthorization is a second person's signed consent to lift one placement of one legal hold. (experimental)

Constructors and functions

  • func NewLiftAuthorization(ctx context.Context, trail EventStore, trailKey Verifier, authorizer Signer, deployment, holdID, reason, ticket, lifterKeyID string, now time.Time, validFor time.Duration) (LiftAuthorization, error): NewLiftAuthorization reads the redaction trail (its records verified under trailKey, the key that signs the trail) and returns authorizer's signed consent to lift the hold holdID as the trail shows it now. (experimental)

type LiftOption ​

go
type LiftOption func(*liftConfig)

LiftOption is an option of LiftLegalHold. (experimental)

Constructors and functions

  • func RequireLiftAuthorization() LiftOption: RequireLiftAuthorization makes LiftLegalHold refuse a lift that has no valid authorization (ErrLiftUnauthorized). (experimental)
  • func WithLiftAuthorization(a LiftAuthorization) LiftOption: WithLiftAuthorization gives LiftLegalHold the second person's authorization to embed in the lift's record. (experimental)
  • func WithLiftAuthorizers(v ...Verifier) LiftOption: WithLiftAuthorizers pins the keys an authorization must be signed by. (experimental)

type MLDSASigner ​

go
type MLDSASigner struct {
	Priv *mldsa.PrivateKey
}

MLDSASigner signs with an ML-DSA-65 private key.

Methods

  • func (MLDSASigner) Alg() Alg: Alg reports the signature scheme (AlgMLDSA65).
  • func (s MLDSASigner) Format(f fmt.State, _ rune): Format writes String for every verb, so no fmt verb prints the key.
  • func (MLDSASigner) MarshalJSON() ([]byte, error): MarshalJSON refuses: the signer holds a private key.
  • func (s MLDSASigner) PublicKey() []byte: PublicKey returns the encoded ML-DSA-65 public key, or nil if there is no key or it is of another ML-DSA parameter set.
  • func (s MLDSASigner) Sign(m []byte) ([]byte, error): Sign returns the deterministic ML-DSA-65 signature over m, or an error if there is no key or it is of another parameter set.
  • func (MLDSASigner) String() string: String returns a description of the signer that does not include the key.

type MLDSAVerifier ​

go
type MLDSAVerifier struct {
	Pub *mldsa.PublicKey
}

MLDSAVerifier verifies with an ML-DSA-65 public key.

Methods

  • func (MLDSAVerifier) Alg() Alg: Alg reports the signature scheme (AlgMLDSA65).
  • func (v MLDSAVerifier) KeyIDs() []string: KeyIDs identifies the public key, for agent.ApproverVerifier: one entry, KeyID(AlgMLDSA65, Pub.Bytes()).
  • func (v MLDSAVerifier) PublicKey() []byte: PublicKey returns the encoded public key, or nil if there is none or it is not ML-DSA-65.
  • func (v MLDSAVerifier) Verify(m, sig []byte) bool: Verify reports whether sig is a valid ML-DSA-65 signature over m.

type MemAnchorLog ​

go
type MemAnchorLog struct {
	// contains filtered or unexported fields
}

MemAnchorLog is a reference external transparency log: an append-only, independently Merkle-committed record of published STHs.

Constructors and functions

  • func NewMemAnchorLog() *MemAnchorLog: NewMemAnchorLog returns an empty transparency log.

Methods

  • func (l *MemAnchorLog) Entries() []AnchorEntry: Entries returns a copy of the anchored entries in order.
  • func (l *MemAnchorLog) Len() int: Len is the number of anchored entries.
  • func (l *MemAnchorLog) Prove(seq int) (Inclusion, error): Prove returns an inclusion proof that the entry at seq is in the anchor log committed by Root, i.e. that a given STH was anchored, disclosing no other entry.
  • func (l *MemAnchorLog) ProveConsistency(first int) (Consistency, error): ProveConsistency proves the first first anchored entries are an append-only prefix of the current log, the transparency-log guarantee that no earlier anchor was rewritten.
  • func (l *MemAnchorLog) Publish(_ context.Context, runID string, sth SignedTreeHead) error: Publish appends an STH for runID at the next sequence.
  • func (l *MemAnchorLog) Root() ([]byte, error): Root is the RFC 6962 Merkle root over all anchored entries, the anchor log's own commitment.

type MemEventStore ​

go
type MemEventStore struct {
	// contains filtered or unexported fields
}

MemEventStore is the in-memory reference EventStore for tests and local dev.

Constructors and functions

  • func NewMemEventStore() *MemEventStore: NewMemEventStore returns an empty in-memory EventStore.

Methods

  • func (s *MemEventStore) Append(_ context.Context, runID string, seq int, leaf []byte) error: Append stores leaf at position seq of runID's trail.
  • func (s *MemEventStore) Load(_ context.Context, runID string) ([][]byte, error): Load returns copies of runID's stored leaves in order, or nil for a run with none.

type Neighbor ​

go
type Neighbor struct {
	Key   string    `json:"key"`
	Proof Inclusion `json:"proof"`
}

Neighbor is one committed key adjacent to an absent key, with its inclusion proof.

type NotifyEventVerdict ​

go
type NotifyEventVerdict struct {
	Trail  string       `json:"trail"`
	Key    string       `json:"key"`
	Kind   string       `json:"kind"`
	RunID  string       `json:"run_id,omitempty"`
	Status NotifyStatus `json:"status"`

	Why string `json:"why,omitempty"`

	InJournal bool `json:"in_journal,omitempty"`

	EventAt     time.Time `json:"event_at,omitzero"`
	ObservedAt  time.Time `json:"observed_at,omitzero"`
	DeadlineAt  time.Time `json:"deadline_at,omitzero"`
	FirstSentAt time.Time `json:"first_sent_at,omitzero"`
	AckedAt     time.Time `json:"acked_at,omitzero"`
	ClearedAt   time.Time `json:"cleared_at,omitzero"`
	Attempts    int       `json:"attempts,omitempty"`
	Rounds      int       `json:"rounds,omitempty"`

	Detection time.Duration `json:"detection_ns,omitempty"`
	Delivery  time.Duration `json:"delivery_ns,omitempty"`
	Total     time.Duration `json:"total_ns,omitempty"`

	Auth *agent.NotifyAuth `json:"auth,omitempty"`

	Receiver string `json:"receiver,omitempty"`
	Level    int    `json:"level,omitempty"`
}

NotifyEventVerdict is the verdict on one event.

type NotifyReport ​

go
type NotifyReport struct {
	Trails   []NotifyTrailReport  `json:"trails"`
	Events   []NotifyEventVerdict `json:"events"`
	Problems []string             `json:"problems,omitempty"`
}

NotifyReport is the result of VerifyNotifications.

Constructors and functions

  • func VerifyNotifications(in NotifyVerifyInput) (NotifyReport, error): VerifyNotifications reads notification trails strictly and says, for every event that needed a person, whether it was notified and acknowledged, and when.

Methods

  • func (r NotifyReport) Counts() map[NotifyStatus]int: Counts returns how many events have each status.
  • func (r NotifyReport) CountsByReceiver() map[string]map[NotifyStatus]int: CountsByReceiver returns, for each receiver, how many of its events have each status.

type NotifyStatus ​

go
type NotifyStatus string

NotifyStatus is what a trail and the run journals together say about one event that needed a person.

Constants

  • const NotifyStatusAcked NotifyStatus = "acked": NotifyStatusAcked: the sink acknowledged the event within its deadline (and within the bound).
  • const NotifyStatusAckedLate NotifyStatus = "acked_late": NotifyStatusAckedLate: acknowledged, but after the event's deadline or the bound.
  • const NotifyStatusPending NotifyStatus = "pending": NotifyStatusPending: observed, not yet acknowledged, and not yet past its deadline at Now.
  • const NotifyStatusFailing NotifyStatus = "failing": NotifyStatusFailing: like pending, and delivery has failed repeatedly (a failing record).
  • const NotifyStatusOverdue NotifyStatus = "overdue": NotifyStatusOverdue: observed, not acknowledged, and past its deadline or the bound at Now.
  • const NotifyStatusClearedBeforeNotification NotifyStatus = "cleared_before_notification": NotifyStatusClearedBeforeNotification: the event stopped being current before any delivery was attempted, so no one was owed a notification.
  • const NotifyStatusClearedUnacknowledged NotifyStatus = "cleared_unacknowledged": NotifyStatusClearedUnacknowledged: delivery was attempted, never acknowledged, and the event then stopped being current.
  • const NotifyStatusNeverNotified NotifyStatus = "never_notified": NotifyStatusNeverNotified: the journal (or the trail itself) shows an event that needed a person and the trail holds no observation of it.
  • const NotifyStatusNotYetDue NotifyStatus = "not_yet_due": NotifyStatusNotYetDue: like never_notified, but the event is younger than the grace period at Now, so a notifier has not yet been late with it.
  • const NotifyStatusUnobservedResolved NotifyStatus = "unobserved_resolved": NotifyStatusUnobservedResolved: the journal shows a gate that was decided, and the trail holds no observation of it.
  • const NotifyStatusAllClearUntimed NotifyStatus = "all_clear_untimed": NotifyStatusAllClearUntimed: an acknowledged event was resolved (the journal shows its gate decided, or its halt resolved) and the trail holds no all-clear, but the resolving record holds no recorded_at (one an earlier version wrote), so the all-clear cannot be judged late.
  • const NotifyStatusUnattested NotifyStatus = "unattested": NotifyStatusUnattested: the event's observation, acknowledgement or clearing is in the records after the newest signed head, which nothing attests: whoever can append to the stored trail could have written it.
  • const NotifyStatusNoDelivery NotifyStatus = "no_delivery": NotifyStatusNoDelivery: the event was delivered to some receiver and not to an expected one (NotifyVerifyInput.ExpectedReceivers).

Methods

  • func (s NotifyStatus) Problem() bool: Problem reports whether a status fails an audit.
  • func (s NotifyStatus) Warning() bool: Warning reports whether a status is shown as a warning: it does not fail an audit unless NotifyVerifyInput.Strict is set.

type NotifyTrail ​

go
type NotifyTrail struct {
	// contains filtered or unexported fields
}

NotifyTrail adapts an EventStore to agent.NotifyTrail: the notification trail of a run is an event trail of its own (named agent.NotifyTrailName), each record a salted, canonical event leaf committed like any other, so EventLog, TreeHead, Prove and ProveConsistency work on it and bide audit can verify it.

Constructors and functions

  • func NewNotifyTrail(store EventStore) *NotifyTrail: NewNotifyTrail returns a NotifyTrail over store.

Methods

  • func (t *NotifyTrail) AnchorTrails(ctx context.Context, trails []string) error: AnchorTrails implements agent.NotifyTrailAnchorer: it asks the AuditedEventStore beneath the trail's store (found through Unwrap, under any decorator) to publish a head for each named trail that has grown past its last one, and for some that an earlier failure left unanchored.
  • func (t *NotifyTrail) Append(ctx context.Context, trail string, seq int, rec agent.NotifyRecord) error: Append implements agent.NotifyTrail.
  • func (t *NotifyTrail) Load(ctx context.Context, trail string) ([]agent.NotifyRecord, error): Load implements agent.NotifyTrail.

type NotifyTrailExport ​

go
type NotifyTrailExport struct {
	Format string   `json:"format"`
	Trail  string   `json:"trail"`
	Leaves [][]byte `json:"leaves"`
}

A NotifyTrailExport is a notification trail as the leaves its EventStore holds, in position order: the input VerifyNotifications and bide audit notifications read when they hold no store.

Constructors and functions

  • func ExportNotifyTrail(ctx context.Context, store EventStore, trail string) (NotifyTrailExport, error): ExportNotifyTrail returns the trail named trail in store as a NotifyTrailExport.

type NotifyTrailReport ​

go
type NotifyTrailReport struct {
	Trail   string `json:"trail"`
	Records int    `json:"records"`

	Anchored bool `json:"anchored"`
	HeadSize int  `json:"head_size,omitempty"`

	Heads int `json:"heads,omitempty"`

	Tail      int           `json:"tail,omitempty"`
	TailSince time.Time     `json:"tail_since,omitzero"`
	TailAge   time.Duration `json:"tail_age_ns,omitempty"`
	HeadTime  time.Time     `json:"head_time,omitzero"`

	Violations []string `json:"violations,omitempty"`
}

NotifyTrailReport is what was established about one trail.

type NotifyVerifyInput ​

go
type NotifyVerifyInput struct {
	Trails []NotifyTrailExport

	Heads []SignedTreeHead

	Verifier Verifier

	Unanchored bool

	Journals []JournalExport

	Stops         *agent.StopState
	StopsWithin   time.Duration
	StopAnomalies []string

	Routing *agent.NotifyRouting

	Strict bool

	Now time.Time

	MaxAck time.Duration

	Grace time.Duration

	RecoveryFailingAfter time.Duration

	MaxTailAge time.Duration

	MaxClockSkew time.Duration
}

NotifyVerifyInput is what VerifyNotifications reads.

type PolicyContent ​

go
type PolicyContent struct {
	Digest string `json:"digest"`
	Policy string `json:"policy"`
}

PolicyContent is the payload of a policy leaf: the serialized governed policy and its digest.

type PolicyConvergence ​

go
type PolicyConvergence struct {
	Digest      string      `json:"digest"`
	PolicyLeaf  ProofBundle `json:"policy_leaf"`
	Certificate ProofBundle `json:"certificate"`
}

PolicyConvergence bundles the anchored evidence for one used policy: its anchored policy leaf and its anchored convergence-certificate leaf, both proven against the run STH.

type ProofBundle ​

go
type ProofBundle struct {
	Format      string         `json:"format"`
	RunID       string         `json:"run_id"`
	RecordBytes []byte         `json:"record_bytes"`
	Inclusion   Inclusion      `json:"inclusion"`
	STH         SignedTreeHead `json:"sth"`
}

A ProofBundle is a single, portable, self-describing artifact that proves ONE action happened inside a signed, committed run.

Constructors and functions

  • func ProveApproval(ctx context.Context, store *agent.Journal, runID, step string, sth SignedTreeHead) (ProofBundle, error): ProveApproval builds a ProofBundle proving one approver-decision record, named step, is committed in the tree sth signs.
  • func ProveConvergence(ctx context.Context, store *agent.Journal, runID, digest string, sth SignedTreeHead) (ProofBundle, error): ProveConvergence builds a ProofBundle proving the convergence certificate for this digest was committed in the tree sth signs.
  • func ProveGrant(ctx context.Context, store *agent.Journal, runID, digest string, sth SignedTreeHead) (ProofBundle, error): ProveGrant builds a ProofBundle proving the grant with this digest was committed in the tree sth signs.
  • func ProvePolicy(ctx context.Context, store *agent.Journal, runID, digest string, sth SignedTreeHead) (ProofBundle, error): ProvePolicy builds a ProofBundle proving the policy with this digest was committed in the tree sth signs.
  • func ProveRecord(ctx context.Context, store *agent.Journal, runID string, index int, sth SignedTreeHead) (ProofBundle, error): ProveRecord builds a bundle proving the record at index is in the tree that sth commits to.
  • func ProveRunCertificate(ctx context.Context, store *agent.Journal, runID string, sth SignedTreeHead) (ProofBundle, error): ProveRunCertificate builds a ProofBundle proving the run certificate leaf for runID was committed in the tree sth signs.
  • func ProveStep(ctx context.Context, store *agent.Journal, runID, name string, sth SignedTreeHead) (ProofBundle, error): ProveStep builds a ProofBundle proving that the durable step with this name (an agent.Journal.Step / Parallel task, recorded as a StepValue) is committed in the tree sth signs.
  • func ProveToolCall(ctx context.Context, store *agent.Journal, runID, toolUseID string, sth SignedTreeHead) (ProofBundle, error): ProveToolCall is the semantic form of ProveRecord: prove that a specific tool call happened, by its ToolUseID, without the caller needing to know its journal index.

Methods

  • func (b ProofBundle) Record() (agent.Record, error): Record decodes the proven record from RecordBytes, for display and role checks.
  • func (b ProofBundle) Verify(v Verifier) error: Verify returns nil if the bundle is internally consistent and authentic under v (a key obtained out-of-band, e.g. from the anchor log operator): the STH verifies under v, it is a journal head of RunID, the inclusion proof is for the signed size, and RecordBytes are the leaf at their index under the signed root.

type ReceiptFinding ​

go
type ReceiptFinding struct {
	Verdict ReceiptVerdict
	Detail  string
}

ReceiptFinding is the verdict on one receipt, with the reason.

Constructors and functions

  • func CheckReceipt(r DecisionReceipt, journal []agent.Record, heads []SignedTreeHead, logKey Verifier) ReceiptFinding: CheckReceipt decides whether the signed tree heads of the run commit to the receipt's decision.

type ReceiptIdentity ​

go
type ReceiptIdentity struct {
	Approver string

	Identifier string

	DisplayName string

	LeafHash, AnchorKey string
	Chain               []string
	NotBefore, NotAfter time.Time

	DecidedAt, AnchoredAt time.Time
	TimeSource            string

	Revocation string
}

ReceiptIdentity is what VerifyIdentity establishes about a certificate-bound receipt.

type ReceiptVerdict ​

go
type ReceiptVerdict string

ReceiptVerdict is what CheckReceipt finds about one receipt.

Constants

  • const ReceiptAnchored ReceiptVerdict = "anchored": ReceiptAnchored: a signed tree head of the journal commits to the decision at its position.
  • const ReceiptRedacted ReceiptVerdict = "redacted (anchored)": ReceiptRedacted: as anchored, and a redaction has since replaced the record's bytes with a tombstone that keeps its leaf hash.
  • const ReceiptPending ReceiptVerdict = "pending": ReceiptPending: the journal holds the decision and no signed head covers its position yet.
  • const ReceiptDeleted ReceiptVerdict = "decision deleted after signing": ReceiptDeleted: the receipt carries an anchoring proof (the decision's record under a signed head A), and a signed head B that matches the journal given reaches the position and commits to something else there.
  • const ReceiptUnmatched ReceiptVerdict: ReceiptUnmatched: the journal does not hold the decision at the receipt's position (or a signed head that matches the journal commits to something else there), and the receipt carries no anchoring proof.
  • const ReceiptUnchecked ReceiptVerdict = "unchecked": ReceiptUnchecked: a head reaches the position but does not match the journal given, or the receipt's anchoring proof does not verify, so nothing can be said of the decision from it.

Methods

  • func (v ReceiptVerdict) Failed() bool: Failed reports whether the verdict is a failure: the journal does not show a decision that the receipt says is there (ReceiptDeleted, proven; ReceiptUnmatched, claimed), or nothing could be checked (ReceiptUnchecked).

type RedactedRef ​

go
type RedactedRef struct {
	Position int    `json:"position"`
	Name     string `json:"name"`
	Kind     string `json:"kind,omitempty"`
	Length   int    `json:"length,omitempty"`
	LeafHash string `json:"leaf_hash"`

	Already bool `json:"already,omitempty"`
}

A RedactedRef names one record a redaction replaces: its position in the run's journal, its name, kind and stored length, and the hex leaf hash its tombstone keeps. (experimental)

type RedactionFinding ​

go
type RedactionFinding struct {
	Kind   RedactionFindingKind `json:"kind"`
	RunID  string               `json:"run_id,omitempty"`
	Detail string               `json:"detail"`
}

A RedactionFinding is one problem VerifyRedactions found. (experimental)

type RedactionFindingKind ​

go
type RedactionFindingKind string

RedactionFindingKind names what VerifyRedactions found wrong. (experimental)

Constants

  • const FindingUnanchored RedactionFindingKind = "UNANCHORED": FindingUnanchored: the trail has no signed head, so nothing shows it is complete. (experimental)
  • const FindingTrailAltered RedactionFindingKind = "TRAIL_ALTERED": FindingTrailAltered: a head contradicts the trail (records deleted or changed). (experimental)
  • const FindingUnattestedTail RedactionFindingKind = "UNATTESTED_TAIL": FindingUnattestedTail: records after the newest signed head. (experimental)
  • const FindingIncomplete RedactionFindingKind = "INCOMPLETE": FindingIncomplete: a begin with no end: an unfinished pass. (experimental)
  • const FindingUnaccounted RedactionFindingKind = "UNACCOUNTED": FindingUnaccounted: a tombstone no trail record names (a redaction made by hand). (experimental)
  • const FindingNotErased RedactionFindingKind = "NOT_ERASED": FindingNotErased: a record the trail lists as erased still holds content. (experimental)
  • const FindingNameMismatch RedactionFindingKind = "NAME_MISMATCH": FindingNameMismatch: a tombstone's name is not the name the trail recorded at that position. (experimental)
  • const FindingHashMismatch RedactionFindingKind = "HASH_MISMATCH": FindingHashMismatch: a tombstone's leaf hash is not the one the trail recorded. (experimental)
  • const FindingUncovered RedactionFindingKind = "UNCOVERED": FindingUncovered: a redaction that ran with no covering signed head. (experimental)
  • const FindingUnderHold RedactionFindingKind = "REDACTED_UNDER_HOLD": FindingUnderHold: a pass erased records of a run a legal hold in force covered. (experimental)
  • const FindingHoldUnmatched RedactionFindingKind = "HOLD_UNMATCHED": FindingHoldUnmatched: a hold_lifted record for a hold the trail shows no active placement of, or a placement of an ID already active. (experimental)
  • const FindingLiftUnauthorized RedactionFindingKind = "LIFT_UNAUTHORIZED": FindingLiftUnauthorized: a hold lift that has no second-person authorization where one is required, or whose embedded authorization does not check out (a bad signature, another hold or placement, expired at the lift, the lifter's own key, or a key that is not a pinned authorizer). (experimental)
  • const FindingHoldNotInStore RedactionFindingKind = "HOLD_NOT_IN_STORE": FindingHoldNotInStore: the trail says a hold is active and the store holds none: lifted by hand. (experimental)
  • const FindingHoldNotInTrail RedactionFindingKind = "HOLD_NOT_IN_TRAIL": FindingHoldNotInTrail: the store holds a hold the trail never recorded: placed by hand. (experimental)
  • const FindingHoldDiffers RedactionFindingKind = "HOLD_DIFFERS": FindingHoldDiffers: the store's hold and the trail's have the same ID and differ in runs, tree setting or matter. (experimental)
  • const FindingReordered RedactionFindingKind = "REORDERED": FindingReordered: a trail record that is not at the position, or after the record, it was signed for: a replayed, copied or reordered record. (experimental)
  • const FindingBadSignature RedactionFindingKind = "BAD_SIGNATURE": FindingBadSignature: a trail record with no signature, or one that does not verify under the key: not the tool's, whatever head covers it. (experimental)
  • const FindingEventCopies RedactionFindingKind = "EVENT_COPIES_KEPT": FindingEventCopies: an erasure that left the run's events in the event store. (experimental)
  • const FindingTimeMismatch RedactionFindingKind = "TIME_MISMATCH": FindingTimeMismatch: a tombstone stamped at a time no pass of the trail that listed it carries. (experimental)
  • const FindingUnchecked RedactionFindingKind = "UNCHECKED": FindingUnchecked: the trail names a run no journal was given for. (experimental)
  • const FindingMalformed RedactionFindingKind = "MALFORMED": FindingMalformed: a trail record that does not read. (experimental)

type RedactionOptions ​

go
type RedactionOptions struct {
	Reason, Ticket string

	Signer Signer

	EventCopiesKept int

	Deployment string

	Executor string

	Now time.Time

	Version string

	Heads    []SignedTreeHead
	Verifier Verifier

	Redactor agent.Redactor

	TrailHeads []SignedTreeHead

	AllowUncovered bool
}

RedactionOptions are what an accountable redaction needs besides the plan. (experimental)

type RedactionRecord ​

go
type RedactionRecord struct {
	Format      string        `json:"format"`
	Phase       string        `json:"phase"`
	PlanDigest  string        `json:"plan_digest"`
	RunID       string        `json:"run_id"`
	Records     []RedactedRef `json:"records,omitempty"`
	JournalSize int           `json:"journal_size,omitempty"`
	Reason      string        `json:"reason"`
	Ticket      string        `json:"ticket"`

	Executor string `json:"executor"`
	AtMs     int64  `json:"at_ms"`
	Version  string `json:"version,omitempty"`

	HeadSize  int  `json:"head_size,omitempty"`
	Uncovered bool `json:"uncovered,omitempty"`

	Redacted int    `json:"redacted,omitempty"`
	Already  int    `json:"already,omitempty"`
	Error    string `json:"error,omitempty"`

	EventCopiesKept int `json:"event_copies_kept,omitempty"`

	Position int    `json:"position"`
	Prev     []byte `json:"prev,omitempty"`

	Deployment string `json:"deployment,omitempty"`

	AckPosition int    `json:"ack_position,omitempty"`
	AckLeafHash string `json:"ack_leaf_hash,omitempty"`

	HoldID     string   `json:"hold_id,omitempty"`
	HoldMatter string   `json:"hold_matter,omitempty"`
	HoldRuns   []string `json:"hold_runs,omitempty"`
	HoldTree   bool     `json:"hold_tree,omitempty"`

	Authorization *LiftAuthorization `json:"authorization,omitempty"`

	Alg       string `json:"alg"`
	Signature []byte `json:"signature"`
}

A RedactionRecord is one leaf of the redaction trail. (experimental)

Constructors and functions

  • func DecodeRedactionLeaf(leaf []byte) (RedactionRecord, error): DecodeRedactionLeaf reads a redaction record from a stored event leaf. (experimental)
  • func LoadRedactionTrail(ctx context.Context, store EventStore) ([]RedactionRecord, error): LoadRedactionTrail returns the records of the redaction trail in store, in order. (experimental)

type RedactionReport ​

go
type RedactionReport struct {
	Records    int                `json:"records"`
	Redactions int                `json:"redactions"`
	Anchored   bool               `json:"anchored"`
	HeadSize   int                `json:"head_size,omitempty"`
	Findings   []RedactionFinding `json:"findings,omitempty"`

	Holds []agent.Hold `json:"holds,omitempty"`

	Notes []string `json:"notes,omitempty"`

	Ended []ErasedEnd `json:"ended,omitempty"`
}

A RedactionReport is the result of VerifyRedactions. (experimental)

Constructors and functions

  • func VerifyRedactions(in RedactionVerifyInput) (RedactionReport, error): VerifyRedactions checks the redaction trail against its signed heads and the journals. (experimental)

Methods

  • func (r RedactionReport) OK() bool: OK reports whether nothing was found. (experimental)

type RedactionVerifyInput ​

go
type RedactionVerifyInput struct {
	Trail [][]byte

	Heads    []SignedTreeHead
	Verifier Verifier

	Unanchored bool

	Deployment string

	StoreHolds *[]agent.Hold

	LiftAuthorizers []Verifier

	RequireLiftAuthorization bool

	Journals map[string][]agent.Record
}

RedactionVerifyInput is what VerifyRedactions checks. (experimental)

type RejectedHead ​

go
type RejectedHead struct {
	Size   int    `json:"size"`
	Reason string `json:"reason"`
}

RejectedHead is a head CheckDecisionCoverage ignored, and why: it does not verify under the log key, or it is not a journal head of the run.

type RunCertSpec ​

go
type RunCertSpec struct {
	ApprovedPolicies []string

	Signer Signer

	TimestampNanos int64
}

RunCertSpec carries the caller's inputs to CertifyRun: what the run was allowed, and how to sign the certificate's used-policy head.

type RunCertificate ​

go
type RunCertificate struct {
	Format string `json:"format"`

	RunID string `json:"run_id"`

	Properties []string `json:"properties"`

	UsedPolicies []string `json:"used_policies"`

	UsedPolicyAbsence SignedTreeHead `json:"used_policy_absence"`

	Convergence []PolicyConvergence `json:"convergence"`

	STH SignedTreeHead `json:"sth"`
}

A RunCertificate is a proof-carrying run: one portable, offline-checkable artifact asserting behavioral-property compliance over a WHOLE run, discharged from the audit package's existing primitives rather than from new cryptography.

Constructors and functions

  • func CertifyRun(ctx context.Context, store *agent.Journal, runID string, sth SignedTreeHead, spec RunCertSpec) (RunCertificate, error): CertifyRun assembles a RunCertificate for runID from its committed leaves, against the run's signed journal head sth.

type RunVerification ​

go
type RunVerification struct {
	OK bool `json:"ok"`

	OnlyApprovedPolicies bool `json:"only_approved_policies"`

	ConvergenceCertified bool `json:"convergence_certified"`

	Reasons []string `json:"reasons,omitempty"`

	Policies []VerifiedPolicy `json:"policies,omitempty"`
}

RunVerification is the structured outcome of VerifyRun: the overall verdict plus per-property results, so a caller (or the CLI) can report exactly which property held and which failed.

Constructors and functions

  • func VerifyRun(cert RunCertificate, approved []string, v Verifier) (RunVerification, error): VerifyRun checks a RunCertificate's claims against the disclosed proofs, the auditor's own approved allowlist, and the out-of-band verifier v, entirely offline.

type SPKIHash ​

go
type SPKIHash [32]byte

SPKIHash is the SHA-256 of a certificate's SubjectPublicKeyInfo.

Constructors and functions

  • func SPKIHashOf(c *x509.Certificate) SPKIHash: SPKIHashOf returns the pin of c's public key.

type ScopeRule ​

go
type ScopeRule func(parent, child string) bool

ScopeRule reports whether child, a changed value for one scope key, is within parent, the parent grant's value for that key.

type ScopeRules ​

go
type ScopeRules map[string]ScopeRule

ScopeRules maps a scope key to the rule that decides whether a changed value narrows it.

type SignedGrant ​

go
type SignedGrant struct {
	Grant Grant  `json:"grant"`
	Alg   Alg    `json:"alg"`
	Sig   []byte `json:"sig"`
}

SignedGrant is a Grant plus the issuer's signature over its canonical bytes.

Constructors and functions

  • func SignGrant(g Grant, s Signer) (SignedGrant, error): SignGrant signs a grant with the issuer's key (Ed25519, ML-DSA, or hybrid, per the Signer).

Methods

  • func (sg SignedGrant) Verify(v Verifier) error: Verify returns nil if the issuer's signature over the grant verifies under v.

type SignedTreeHead ​

go
type SignedTreeHead struct {
	Format string `json:"format"`
	TreeHead

	Alg       Alg    `json:"alg"`
	Signature []byte `json:"signature"`
}

SignedTreeHead is a TreeHead with a signature over its canonical encoding under the scheme Alg names.

Constructors and functions

  • func SignAbsenceRoot(records []agent.Record, set KeySet, journal TreeHead, s Signer, timestamp int64) (SignedTreeHead, error): SignAbsenceRoot commits and signs a run's key set in one call: NewAbsenceTreeHead, then SignTreeHead with s.
  • func SignNotifyTrail(ctx context.Context, store EventStore, trail string, s Signer, now time.Time) (SignedTreeHead, error): SignNotifyTrail signs a tree head over the leaves store holds for trail, at now.
  • func SignRedactionTrail(ctx context.Context, store EventStore, signer Signer, v Verifier, deployment string, prior []SignedTreeHead, now time.Time) (SignedTreeHead, error): SignRedactionTrail signs a tree head over the redaction trail in store, after checking the trail is the one the earlier heads attest: every head in prior must verify under v, be a head of the trail, and commit to a prefix of it, and every record in the trail must carry a signature that verifies under v. (experimental)
  • func SignStopTrail(ctx context.Context, store EventStore, trail string, s Signer, now time.Time) (SignedTreeHead, error): SignStopTrail signs a tree head over the leaves store holds for trail, at now: the head AuditedEventStore publishes as records arrive, for a deployment that signs on its own schedule. (experimental)
  • func SignStopTrailExport(exp StopTrailExport, s Signer, now time.Time) (SignedTreeHead, error): SignStopTrailExport signs a tree head over exactly the leaves exp carries, at now: the head bide audit stops -sign-head appends to a head file after it has verified those leaves. (experimental)
  • func SignTreeHead(th TreeHead, s Signer) (SignedTreeHead, error): SignTreeHead signs th under s's scheme.

Methods

  • func (h SignedTreeHead) Hash() [32]byte: Hash is the SHA-256 of the signed head's canonical encoding followed by its signature, length prefixed: what identifies this head, so two heads with the same size and root but different timestamps or signatures differ.
  • func (sth SignedTreeHead) Verify(v Verifier) error: Verify returns nil if the STH's signature is valid under v: the head is of format STHFormat, of a known kind and shape, signed under v's scheme, and its signature over its canonical encoding (scheme included) verifies.

type Signer ​

go
type Signer interface {
	Alg() Alg

	PublicKey() []byte

	Sign(message []byte) ([]byte, error)
}

Signer produces signatures under one scheme with one key.

type SnapshotOption ​

go
type SnapshotOption func(*StatusSnapshot)

SnapshotOption configures NewStatusSnapshot.

Constructors and functions

  • func WithIssuers(certs ...*x509.Certificate) SnapshotOption: WithIssuers names the CA certificates whose CRLs the snapshot is for.
  • func WithLimits(maxBytes, maxEntries int) SnapshotOption: WithLimits sets the largest CRL accepted in bytes and in entries (defaults 16 MiB and 1,000,000).
  • func WithMaxCRLs(n int) SnapshotOption: WithMaxCRLs bounds how many CRLs the snapshot keeps (default 1024; a value below 1 keeps the default).
  • func WithUnboundedCRLs() SnapshotOption: WithUnboundedCRLs removes the bound on how many CRLs the snapshot keeps, for an audit tool that loads an archived series and must not lose any of it.

type StatusArchive ​

go
type StatusArchive interface {
	PutStatus(ctx context.Context, hash string, der []byte) error
}

StatusArchive stores the bytes of a CRL too large for the journal (agent.MaxStatusInline) under its SHA-256 (lowercase hex), durably, before the gate records its hash.

type StatusDecl ​

go
type StatusDecl struct {
	Params           StatusParams
	ExecStatusAge    time.Duration
	ExecStatusAgeFor map[SPKIHash]time.Duration
	CAOverlapFor     map[SPKIHash]time.Duration
	DeltaPeriodFor   map[SPKIHash]time.Duration

	ClockTolerance time.Duration
	EffectiveFrom  time.Time
	// contains filtered or unexported fields
}

StatusDecl is the declared CA timings read from a file.

Constructors and functions

  • func ParseStatusDecl(name string, b []byte) (StatusDecl, error): ParseStatusDecl reads the declaration file.

Methods

  • func (d StatusDecl) Approver(policy *CertIdentity, snap *StatusSnapshot, now func() time.Time) (*CertApprover, error): Approver builds the CertApprover the refresher reads its declared values from, for a refresher run outside a gate.
  • func (d StatusDecl) MissingForDigest() []string: MissingForDigest returns, sorted, the members of the declaration the policy digest covers and the file does not state.

type StatusError ​

go
type StatusError struct {
	Reason string
	Detail string
}

StatusError is a status failure.

Methods

  • func (e *StatusError) Error() string: Error reports the reason and the detail.

type StatusParams ​

go
type StatusParams struct {
	W time.Duration

	MinW time.Duration

	RoutineGrace time.Duration

	Now          time.Time
	MaxStatusAge time.Duration

	MaxStatusAgeFor map[SPKIHash]time.Duration

	CountLive bool

	Distrust map[SPKIHash]time.Time

	Retained bool

	CAPeriod time.Duration

	CAPeriodFor map[SPKIHash]time.Duration

	ConsecutiveNumbers bool

	CoverageTolerance time.Duration

	ThisUpdateSkew    time.Duration
	ThisUpdateSkewFor map[SPKIHash]time.Duration

	AllowHolds bool
}

StatusParams are the knobs of the status rule.

Methods

  • func (p StatusParams) Validate() error: Validate checks the status parameters when a gate is configured, so a bad value fails at startup and not at the first decision.

type StatusSnapshot ​

go
type StatusSnapshot struct {
	// contains filtered or unexported fields
}

StatusSnapshot is a set of CRLs: what a gate fetched, or an auditor's archived series.

Constructors and functions

  • func NewStatusSnapshot(opts ...SnapshotOption) *StatusSnapshot: NewStatusSnapshot returns an empty snapshot.

Methods

  • func (s *StatusSnapshot) AddCRL(der []byte) (CRLInfo, error): AddCRL parses a CRL and keeps it, or refuses it with a *StatusError (ReasonStatusUnknown) naming why.
  • func (s *StatusSnapshot) AddCRLNoEvict(der []byte) (CRLInfo, error): AddCRLNoEvict is AddCRL that never drops a CRL to make room: with the snapshot full it returns ErrSnapshotFull.
  • func (s *StatusSnapshot) Evicted() int: Evicted is the number of CRLs the snapshot has dropped to stay within WithMaxCRLs.
  • func (s *StatusSnapshot) HeldCRLs(issuer *x509.Certificate) []*CRL: HeldCRLs returns the CRLs the snapshot holds that verify under issuer, ordered by thisUpdate and then number.
  • func (s *StatusSnapshot) Len() int: Len is the number of distinct CRLs held.
  • func (s *StatusSnapshot) Limits() (maxBytes, maxEntries, maxCRLs int): Limits returns the largest CRL the snapshot accepts in bytes and in entries, and how many CRLs it keeps (0: unbounded).
  • func (s *StatusSnapshot) RemoveCRL(hash [32]byte) bool: RemoveCRL drops the CRL with the given hash from the snapshot without touching the eviction count (Evicted), and reports whether it was held.

type StatusTier ​

go
type StatusTier int

StatusTier is how strong the evidence of absence from the CRLs is.

Constants

  • const TierNoInformation StatusTier: TierNoInformation: no usable status.
  • const TierProvisional StatusTier: TierProvisional: status exists but a later one could change the answer (it ends before A+W', the window is short, or the series is not shown complete to L(C)).
  • const TierFinal StatusTier: TierFinal: status reaches A+W' over a window of at least MinW, and the series is complete.

Methods

  • func (t StatusTier) String() string: String names the tier.

type StopReport ​

go
type StopReport struct {
	Records       int               `json:"records"`
	Anchored      bool              `json:"anchored"`
	Heads         int               `json:"heads"`
	HeadSize      int               `json:"head_size"`
	HeadTime      time.Time         `json:"head_time"`
	Tail          int               `json:"tail"`
	TailAge       time.Duration     `json:"tail_age,omitempty"`
	Mode          string            `json:"mode"`
	PolicyDigest  string            `json:"policy_digest,omitempty"`
	PolicySeq     int               `json:"policy_seq"`
	Stops         []StopReportEntry `json:"stops"`
	RejectedTotal int               `json:"rejected_total"`
	Rejected      []agent.Rejection `json:"rejected,omitempty"`
	ChainErr      string            `json:"chain_error,omitempty"`

	StoreOnly []StopReportRecord `json:"store_only,omitempty"`
	TrailOnly []StopReportRecord `json:"trail_only,omitempty"`

	Problems []string `json:"problems,omitempty"`

	Unapplied []StopReportRecord `json:"unapplied,omitempty"`

	Superseded []StopReportRecord `json:"superseded,omitempty"`
}

StopReport is what VerifyStops found. (experimental)

Constructors and functions

  • func VerifyStops(in StopVerifyInput) (StopReport, error): VerifyStops checks a stop trail: that its signed heads verify and commit to prefixes of it (so no record was deleted, changed or reordered since a head covered it), that every record decodes and verifies under the policy the deployment pinned and the chain of policy transitions from its root (a record that does not is a problem: a forgery written into the trail, or a trail from another deployment), that the chain can be trusted, and, with the control run, that the two hold the same records. (experimental)

type StopReportEntry ​

go
type StopReportEntry struct {
	ID           string   `json:"id"`
	Scope        string   `json:"scope"`
	Reason       string   `json:"reason,omitempty"`
	By           string   `json:"by"`
	At           string   `json:"at"`
	Signed       bool     `json:"signed"`
	Lifted       bool     `json:"lifted"`
	LiftedBy     []string `json:"lifted_by,omitempty"`
	LiftsHeld    int      `json:"lifts_held,omitempty"`
	LiftsNeeded  int      `json:"lifts_needed,omitempty"`
	Compensation string   `json:"compensation,omitempty"`
}

StopReportEntry is one stop as VerifyStops reports it. (experimental)

type StopReportRecord ​

go
type StopReportRecord struct {
	Kind string `json:"kind"`
	By   string `json:"by"`
	At   string `json:"at"`
	ID   string `json:"id,omitempty"`
}

StopReportRecord names a record in a comparison finding. (experimental)

type StopTrail ​

go
type StopTrail struct {
	// contains filtered or unexported fields
}

StopTrail adapts an EventStore to agent.StopTrail: the stop trail of a deployment is an event trail of its own (named agent.StopTrailName), each signed stop record a salted, canonical event leaf committed like any other, so EventLog, TreeHead, Prove and ProveConsistency work on it, an AuditedEventStore signs and anchors its heads, and bide audit stops can verify it. (experimental)

Constructors and functions

  • func NewStopTrail(store EventStore) *StopTrail: NewStopTrail returns a StopTrail over store. (experimental)

Methods

  • func (t *StopTrail) AnchorTrails(ctx context.Context, trails []string) error: AnchorTrails asks the AuditedEventStore beneath the trail's store (found through Unwrap) to publish a head for each named trail that has grown past its last one. (experimental)
  • func (t *StopTrail) Append(ctx context.Context, trail string, seq int, rec agent.StopRecord) error: Append implements agent.StopTrail. (experimental)
  • func (t *StopTrail) Load(ctx context.Context, trail string) ([]agent.StopRecord, error): Load implements agent.StopTrail. (experimental)

type StopTrailExport ​

go
type StopTrailExport struct {
	Format string   `json:"format"`
	Trail  string   `json:"trail"`
	Leaves [][]byte `json:"leaves"`
}

A StopTrailExport is the stop trail as the leaves its EventStore holds, in position order: what VerifyStops and bide audit stops read when they hold no store. (experimental)

Constructors and functions

  • func ExportStopTrail(ctx context.Context, store EventStore, trail string) (StopTrailExport, error): ExportStopTrail returns the trail named trail in store as a StopTrailExport. (experimental)

type StopVerifyInput ​

go
type StopVerifyInput struct {
	Trail StopTrailExport

	Heads    []SignedTreeHead
	Verifier Verifier

	Unanchored bool

	Now          time.Time
	MaxClockSkew time.Duration
	MaxTailAge   time.Duration

	Options []agent.StopOption

	Control     []agent.StopRecord
	HaveControl bool
}

StopVerifyInput is what VerifyStops checks: a stop trail, the signed heads over it, the policy the deployment pinned, and, when the control run is at hand, its records to compare with. (experimental)

type TimeCheck ​

go
type TimeCheck struct {
	AskedAt   string
	HeadAt    string
	Tolerance time.Duration
}

TimeCheck is what CheckDecisionTimes compares decisions' times with: when the run asked (ApprovalVerdict.AskedAt), when the signed tree head covering the decisions was signed (ApprovalVerdict.HeadAt; "" skips that check), and how far clocks may disagree (Tolerance; negative is zero).

type TreeHead ​

go
type TreeHead struct {
	Kind  string `json:"kind"`
	RunID string `json:"run_id"`
	Size  int    `json:"size"`
	Root  []byte `json:"root"`

	TimestampNanos int64 `json:"timestamp_nanos"`

	Journal *TreeRef `json:"journal,omitempty"`
}

TreeHead is a commitment to one tree of a run at a point in time.

Constructors and functions

  • func NewAbsenceTreeHead(records []agent.Record, set KeySet, journal TreeHead, timestamp int64) (TreeHead, error): NewAbsenceTreeHead builds the key-set tree head for set over a run's journal.
  • func NewTreeHead(ctx context.Context, store *agent.Journal, runID string, timestamp int64) (TreeHead, error): NewTreeHead builds a TreeHead committing to runID's journal at the given timestamp.

Methods

  • func (th TreeHead) SameTree(o TreeHead) bool: SameTree reports whether th and o commit to the same tree: the same kind, run, size, root, and (for a key-set tree) source journal.

type TreeRef ​

go
type TreeRef struct {
	Size int    `json:"size"`
	Root []byte `json:"root"`
}

TreeRef names one tree of a run by its size and root.

type VerifiedPolicy ​

go
type VerifiedPolicy struct {
	Digest      string          `json:"digest"`
	Policy      string          `json:"policy"`
	Certificate json.RawMessage `json:"certificate"`
}

VerifiedPolicy is one used policy as VerifyRun read it from its anchored leaves: the policy bytes from the policy leaf and the serialized convergence certificate from the convergence leaf.

type Verifier ​

go
type Verifier interface {
	Alg() Alg

	PublicKey() []byte

	Verify(message, signature []byte) bool

	KeyIDs() []string
}

Verifier checks signatures under one scheme with one public key.

Constructors and functions

  • func NewVerifier(alg Alg, pub []byte) (Verifier, error): NewVerifier returns the verifier of scheme alg for the encoded public key pub:
  • func ParsePublicKey(s string) (Verifier, error): ParsePublicKey reads the text form of a public key (FormatPublicKey) and returns its verifier.
  • func VerifierOf(s Signer) (Verifier, error): VerifierOf returns the verifier for s's public key: NewVerifier(s.Alg(), s.PublicKey()).

Apache-2.0 licensed.