Skip to main content

Example adapter from AgentMesh AuditEntry output to an external accountability export shape

Project description

Audit Accountability Export

This integration is a small example adapter for mapping real AgentMesh AuditEntry / AuditService output into a smallest-stable external accountability export shape.

It follows the interoperability discussion in issue #1314 and the docs-only note merged in PR #1319.

Purpose

The adapter treats AGT audit output as upstream runtime-governance evidence and emits a compact downstream accountability shape with:

  • actor reference
  • subject reference
  • operation
  • policy digest
  • decision
  • occurrence timestamp
  • input and output references
  • evidence references

The EEOAP mapping function is an external mapping example. It does not import an external validator and does not imply official AGT runtime support for EEOAP.

Non-goals

  • no AGT runtime changes
  • no AuditEntry / AuditService contract changes
  • no replacement of agt verify --evidence
  • no new AGT-native evidence format
  • no required dependency on EEOAP or external validators
  • no production compliance claim

Pipeline

AuditService output
-> AuditEntry
-> external accountability export shape
-> EEOAP mapping example

Example

from agentmesh.services.audit import AuditService
from audit_accountability_export import (
    accountability_export_to_eeoap_statement,
    audit_entry_to_accountability_export,
)

audit = AuditService()
entry = audit.log_policy_decision(
    "did:mesh:research-agent",
    "metadata.enrich",
    decision="allow",
    policy_name="approved-metadata-policy",
    data={
        "subject_ref": "urn:demo:client-note-001",
        "input_refs": ["urn:demo:client-note-001"],
        "output_refs": ["urn:demo:client-note-001-derived"],
    },
)

export = audit_entry_to_accountability_export(entry)
statement = accountability_export_to_eeoap_statement(export)

Export shape

{
  "export_type": "agt.audit_entry.external_accountability_export",
  "export_version": "0.1",
  "actor_ref": "...",
  "subject_ref": "...",
  "operation": "...",
  "policy_digest": "...",
  "decision": "...",
  "occurred_at": "...",
  "input_refs": [],
  "output_refs": [],
  "evidence_refs": []
}

Sensitivity note

Exported data may include values derived from AuditEntry.data. Review and redact sensitive fields before sharing externally. This example is intended to demonstrate a smallest-stable external accountability export shape, not to define a blanket-safe export for all audit records.

Running locally

From the repository root:

pip install .[dev]

PYTHONPATH=agent-governance-python/agent-mesh/src:agent-governance-python/agentmesh-integrations/audit-accountability-export \
  python -m pytest agent-governance-python/agentmesh-integrations/audit-accountability-export/tests -q

PYTHONPATH=agent-governance-python/agent-mesh/src:agent-governance-python/agentmesh-integrations/audit-accountability-export \
  python agent-governance-python/agentmesh-integrations/audit-accountability-export/examples/basic_auditservice_export.py

The tests create real AuditService entries and use the returned AuditEntry objects as the source. They do not rely on static synthetic fixtures.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

agentmesh_audit_export-3.5.0.tar.gz (4.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

agentmesh_audit_export-3.5.0-py3-none-any.whl (4.8 kB view details)

Uploaded Python 3

File details

Details for the file agentmesh_audit_export-3.5.0.tar.gz.

File metadata

  • Download URL: agentmesh_audit_export-3.5.0.tar.gz
  • Upload date:
  • Size: 4.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: RestSharp/106.13.0.0

File hashes

Hashes for agentmesh_audit_export-3.5.0.tar.gz
Algorithm Hash digest
SHA256 a6933e7f6fd22716dc9346c3c0c2bd4ffda80fc94af5f19804ad976005691247
MD5 1db2ca9ed96a3a6cd92f7f86e6a9bbbb
BLAKE2b-256 885b099e732d929895f6d61d8ace70149b41cf4e51509102731494a1009b3ce4

See more details on using hashes here.

File details

Details for the file agentmesh_audit_export-3.5.0-py3-none-any.whl.

File metadata

File hashes

Hashes for agentmesh_audit_export-3.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ce9e9c8b7293bd52e5f26f09caa5a7a518d91a3b4723f45ce1dcaab633bbd1a0
MD5 3e2e630ecb38e5e16f753f76b0e81a5c
BLAKE2b-256 eae402745bbca4e65c6f20021d7a7c91e6e859d5bcd1c76ad0e349c8df2b276e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page