Sequesign

v0.4.1
io.github.Sequesign/sequesign Checked 2 days ago Published 3 months ago

Cryptographically verifiable receipts of an agent's delegated work, verified offline.

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

sequesign_start_session Start a Sequesign session

Open a new receipt-recording session (one signed action chain). Returns a sessionId (the receiptId) used by the other tools. Provide a policyContext object to bind the receipt to a policy (reaches verification level L3_POLICY_BOUND).

ParameterTypeDescription
delegatorId *stringWho delegated the task (the principal the agent acts for).
taskId *stringStable identifier for the delegated task.
agentIdstringIdentifier for the acting agent. Defaults to 'sequesign-mcp-agent'.
modestringOverride the server's default transport for this session. 'direct' signs locally and the independent witness co-signs (self_asserted identity, you keep the envelope). 'managed' routes through the brok…
paramsobjectBind concrete values to a parameterized template's `parameters` (e.g. { max_amount: 5000 }). Requires `profile`, and that template must declare usable parameters. When supplied, the values are committ…
policyContextobjectPolicy the agent operates under (object). Hashed into the receipt's policy_context_hash; presence raises the receipt to L3_POLICY_BOUND.
profilestringRegistered workflow template to bind this receipt to, given by its profile_id (e.g. 'sequesign.invoice_payment.v0.1'). When set, the session records in profile_constrained mode: each action must be a…

sequesign_record_action Record an action

Append a signed action to the session's chain. evidence is the structured record of what the agent did or observed; it is hashed and signed. Returns the actionId (use it as attestedActionId for a counterparty attestation).

ParameterTypeDescription
actionType *stringShort snake_case label for the action (e.g. 'invoice_policy_checked').
sessionId *stringThe receiptId returned by sequesign_start_session.
evidenceStructured evidence for the action (any JSON value). Hashed and signed.
metadataobjectOptional non-signed-over metadata (e.g. agent reasoning).
schemaIdstringOverride the registered schema for this action (a schema_id). Only used when the session is schema/profile-bound; by default the schema is resolved from actionType. Ignored for freeform sessions.
verifiabilityClassstringHow the evidence can be verified. Defaults to 'deterministic'.

sequesign_record_approval Record an approval

Attach a signed approval for an action already recorded in this session (e.g. a human or independent agent reviewer signing off). The action being approved must already be recorded. If no approverPrivateKeyPem is given, an ephemeral key is minted and the approval leg stays present_unverified; supply an enrolled key plus identityProofRef to make it a vouched (present_verified) approval.

ParameterTypeDescription
approvedActionType *stringThe action_type being approved (must match a recorded action).
approverId *stringIdentity of the approver (lowercase email or label, e.g. 'cfo@acme.example').
sessionId *stringThe receiptId returned by sequesign_start_session.
approvalContextWhat is being approved (any JSON value). Hashed into the signed approval.
approverPrivateKeyPemstringEd25519 private-key PEM of the approver. Omit to mint an ephemeral key.
identityProofRefstringbase64url SignedRegistrationRecord (issuer 'sequesign') from enrollment, to make the approval vouched (present_verified).
partyTypestringWhether the approver is a human or an agent reviewer. Defaults to 'human'.

sequesign_record_counterparty_attestation Record a counterparty attestation

Attach a counterparty's signed confirmation of an action already recorded in this session (e.g. a vendor confirming a corrected invoice total). The SDK derives the content binding from the attested action, so the confirmation cannot be pointed at content the counterparty never saw. If no counterpartyPrivateKeyPem is given, an ephemeral key is minted (present_unverified); supply an enrolled key plus identityProofRef for a vouched (present_verified) attestation.

ParameterTypeDescription
attestationPurpose *stringWhy the counterparty is signing (e.g. 'invoice_amount_confirmation').
attestedActionId *stringThe actionId (from sequesign_record_action) the counterparty is confirming.
counterpartyId *stringCanonical counterparty id (lowercase alphanumeric segments joined by single dots or hyphens, e.g. 'vendor-abc').
sessionId *stringThe receiptId returned by sequesign_start_session.
counterpartyPrivateKeyPemstringEd25519 private-key PEM of the counterparty. Omit to mint an ephemeral key.
identityProofRefstringbase64url SignedRegistrationRecord (issuer 'sequesign') from enrollment, to make the attestation vouched (present_verified).

sequesign_approve_receipt Approve a sealed receipt (deferred satellite)

Attach an independently-witnessed APPROVAL to an already-finalized receipt, without modifying it. Use this when a reviewer (human or another agent) signs off after the receipt was sealed — e.g. one model approves work another model recorded. The approval is bound to the sealed receipt by hash, witnessed at its own time, and written to the package's attestations sidecar. The approver MUST be distinct from the recording agent. If no approverPrivateKeyPem is given an ephemeral key is minted (present_unverified); pass an enrolled key + identityProofRef to vouch.

ParameterTypeDescription
approvedActionType *stringThe action_type being approved (must match an action in the sealed receipt).
approverId *stringIdentity of the approver (lowercase email or label, e.g. 'reviewer@acme.example').
packageDirectory *stringPath to the sealed .sequesign package directory (the receipt to approve).
approvalContextWhat is being approved (any JSON value). Hashed into the signed approval.
approverPrivateKeyPemstringEd25519 private-key PEM of the approver. Omit to mint an ephemeral key.
identityProofRefstringbase64url SignedRegistrationRecord (issuer 'sequesign') from enrollment, to make the approval vouched (present_verified).
modestringTransport for the witness seal. It MUST match how the receipt was sealed — the satellite must be witnessed by the same witness that sealed the receipt, or the verifier drops it (satellite_seal_untru…
partyTypestringWhether the approver is a human or an agent reviewer. Defaults to 'human'.
receiptUrlstringBind the approval to the broker-STORED receipt at this URL instead of the local package's receipt.json. In managed mode the stored copy carries the registered agent identity (different hash), so bindi…

sequesign_countersign_receipt Countersign a sealed receipt (deferred counterparty satellite)

Attach an independently-witnessed COUNTERPARTY confirmation to an already-finalized receipt, without modifying it. Use this when a counterparty (e.g. a vendor, or another model acting as one) confirms an action after the receipt was sealed. The confirmation is bound to the sealed receipt + the attested action by hash, witnessed at its own time, and written to the package's attestations sidecar. If no counterpartyPrivateKeyPem is given an ephemeral key is minted (present_unverified); pass an enrolled key + identityProofRef to vouch.

ParameterTypeDescription
attestationPurpose *stringWhy the counterparty is signing (e.g. 'delivery_confirmation').
attestedActionId *stringThe actionId in the sealed receipt the counterparty is confirming.
counterpartyId *stringCanonical counterparty id (lowercase alphanumeric segments joined by single dots or hyphens, e.g. 'vendor-abc').
packageDirectory *stringPath to the sealed .sequesign package directory (the receipt to countersign).
counterpartyPrivateKeyPemstringEd25519 private-key PEM of the counterparty. Omit to mint an ephemeral key.
identityProofRefstringbase64url SignedRegistrationRecord (issuer 'sequesign') from enrollment, to make the attestation vouched (present_verified).
modestringTransport for the witness seal. It MUST match how the receipt was sealed — the satellite must be witnessed by the same witness that sealed the receipt, or the verifier drops it (satellite_seal_untru…
receiptUrlstringBind the confirmation to the broker-STORED receipt at this URL instead of the local package's receipt.json. In managed mode the stored copy carries the registered agent identity (different hash), so b…

sequesign_finalize Finalize the receipt

Seal the session into a verifiable receipt package and run the SDK's own verification. After finalize the sessionId is closed (removed from memory). Returns the package directory (and the stored receipt URL in managed mode) plus a verification summary.

ParameterTypeDescription
sessionId *stringThe receiptId returned by sequesign_start_session.

sequesign_verify Verify a receipt package

Verify a sealed Sequesign receipt. Modes: (1) default — an integrity self-check of the local package (trust anchor is the receipt's own embedded witness keys); (2) pass trustedWitnessKeysJson and/or trustedRegistrationKeysJson for a third-party 'external' trust check and registered-identity promotion; (3) set fetchAnchors:true to auto-fetch those witness + registration anchors from the configured well-knowns (so a local direct-mode receipt reports external trust and a registered identity without pasting JSON); (4) pass receiptUrl to verify the broker-STORED receipt (the authoritative copy th…

ParameterTypeDescription
packageDirectory *stringPath to the .sequesign package directory (the actions/evidence/keys live here).
fetchAnchorsbooleanLocal verify only (ignored with receiptUrl): auto-fetch the witness keys and platform registration-keys from the configured SEQUESIGN_WITNESS_URL / SEQUESIGN_DASHBOARD_API_URL well-knowns, so the resu…
receiptUrlstringThe broker-stored receipt URL (the receipt_url from finalize). When set, the stored envelope is fetched (with SEQUESIGN_API_KEY) and verified against packageDirectory, with witness + registration anch…
trustedRegistrationKeysJsonstringContents of the platform's published registration-keys.json, to flip the agent/approver/counterparty legs to verified. With receiptUrl it overrides the auto-fetched registration anchors.
trustedWitnessKeysJsonstringContents of the witness's published keys.json. Provided → 'external' trust check; omitted (and no receiptUrl) → the receipt's embedded keys are used ('self', integrity only). With receiptUrl it ov…

sequesign_list_templates List workflow templates

List the Sequesign workflow templates (profiles) available for profile_constrained sessions: the bundled templates (full detail), plus — when a template registry is configured (SEQUESIGN_TEMPLATE_REGISTRY_URL) — templates published to it (manifest-level entries; call sequesign_get_template for a remote template's full detail). Every entry gives the profile_id (pass it to sequesign_start_session), its curation tier (official | verified | community | experimental — discovery metadata, NOT a security control), its source (bundled vs the registry), and details_available (false for remote man…

ParameterTypeDescription
tierstringOnly return templates in this curation tier.

sequesign_get_template Get a workflow template

Fetch one workflow template by profile_id (bundled, or from the configured registry): its full profile document (allowed_actions, required_actions, allowed_transitions, parameters, conditional_requirements, required_attestations, and any evidence_schemas), plus its profile_hash, curation tier, source, session_ready, and whether it is author-signed. session_ready reflects the intended transport (the `mode` argument, else the server's default): a registry template is session_ready only under direct mode. Use this to learn a template's rules before starting a profile_constrained session or before…

ParameterTypeDescription
profileId *stringThe template's profile_id (e.g. from sequesign_list_templates).
modestringThe transport you intend to start the session with (mirrors sequesign_start_session's mode override). Determines session_ready for a registry template — remote binding is direct-only. Defaults to th…

sequesign_check_action Check an action against a template

Pre-flight a single action against a workflow template BEFORE recording it, so you learn a violation up front instead of in the finalized receipt's conformance report. Given a template (profileId), the action type, the session's bound parameters, and optionally the actions already recorded (priorActionTypes) and a draft evidence object, it reports: whether the action is allowed, whether the transition is valid, any parameter-binding errors, the concrete evidence schema for this action (with $param/$allowlist resolved against your params), whether a session can even be started for this template…

ParameterTypeDescription
actionType *stringThe action type you intend to record next.
profileId *stringThe template's profile_id to check against (from sequesign_list_templates).
evidenceA draft evidence object for the action. When the template declares an evidence_schema for actionType, the evidence is validated against the resolved schema and evidenceValid is reported.
modestringThe transport you intend to start the session with (mirrors sequesign_start_session's mode override). Determines startability for a registry template — remote binding is direct-only. Defaults to the…
paramsobjectThe parameter values you would bind at session start, bound against the template's `parameters` block (same rules as sequesign_start_session). Required if the template declares required parameters.
priorActionTypesarrayThe action types already recorded on the chain, in order. Supply to check the transition into actionType (START -> actionType for an empty array). Omit to skip the transition check.