Skip to content

API Reference parrot.roost.audit

github-actions[bot] edited this page Dec 2, 2026 · 4 revisions

parrot.roost.audit

View source

Roost audit ledger — one signed line per performative (FEAT-747 M10).

Alias AbstractKMSSigner

Re-exported from parrot.security.audit_ledger.AbstractKMSSigner.

Alias InteractionProtocol

Re-exported from parrot.roost.performatives.InteractionProtocol.

Alias LocalHMACSigner

Re-exported from parrot.security.audit_ledger.LocalHMACSigner.

Alias Performative

Re-exported from parrot.roost.performatives.Performative.

Class RoostAuditEntry

One signed audit line for a single Roost performative.

Fields:

Field Type Default Description
entry_id str
direction Literal['served', 'received']
sender str
receiver str
performative Performative
protocol InteractionProtocol
conversation_id str
message_id str
trace_id Optional[str] None
result_digest Optional[str] None
body Optional[str] None
signature str ''
created_at datetime

Method RoostAuditEntry.canonical_bytes

Return the canonical bytes that are signed (everything except signature).

canonical_bytes() -> bytes

Returns: bytes — UTF-8 encoded canonical JSON of the entry.

Class RoostAuditLedger

Sibling of AuditLedger that records one signed entry per performative.

Parameter Type Default Description
signer Optional[AbstractKMSSigner] None KMS signer; defaults to a LocalHMACSigner with a random secret.
storage Optional[Any] None Optional duck-typed backend exposing async store(entry).

Method RoostAuditLedger.record

Build, sign and persist the entry for msg.

record(msg: RoostMessage, *, direction: Literal['served', 'received'], self_name: str) -> RoostAuditEntry

Parameter Type Default Description
msg RoostMessage The Roost message being audited.
direction Literal['served', 'received'] served on the serving agent, received on the caller (the conversation initiator). The counterpart is derived from the message, not from direction.
self_name str Name of the agent owning this ledger.

Returns: RoostAuditEntry — The signed entry.

Raises:

  • Exception — Any storage error is logged and re-raised (fail-closed audit).

Method RoostAuditLedger.verify

Verify an entry's signature against its canonical bytes.

verify(entry: RoostAuditEntry) -> bool

Parameter Type Default Description
entry RoostAuditEntry Entry to verify.

Returns: bool — True when the signature matches.

Method RoostAuditLedger.entries

Return entries filtered by conversation and/or trace id.

entries(*, conversation_id: Optional[str] = None, trace_id: Optional[str] = None) -> list[RoostAuditEntry]

Parameter Type Default Description
conversation_id Optional[str] None Optional conversation filter.
trace_id Optional[str] None Optional trace filter.

Returns: list[RoostAuditEntry] — Matching entries in insertion order.

Alias RoostMessage

Re-exported from parrot.roost.messages.RoostMessage.

Attribute logger

Architecture

Clients

Bots & Agents

Memory

Knowledge

Tools & Toolkits

Flows

Experts

Skills

Stores & Loaders

MCP & A2A

Server & APIs

Integrations

Outputs & A2UI

Prompts

Security

Operations

Migration

SDD Tooling

LLM Wiki

Deployment

Decisions

API Reference

Clone this wiki locally