Skip to content

Audit log query API -- GET /security/audit #1121

@Aureliolo

Description

@Aureliolo

Problem

AuditLog in src/synthorg/security/audit.py records every security evaluation with agent, tool, verdict, and evidence. But there is no GET /security/audit query endpoint. The audit trail is write-only from an API perspective -- it can only be accessed via log sinks (file/syslog/HTTP) or by directly reading the persistence layer.

External control-plane consumers (SIEM integrations, compliance tooling) need queryable access to the audit trail.

Source: docs/research/control-plane-audit.md (G5), closes research #688.

Solution

Add GET /security/audit with filters:

  • agent_id -- filter by agent
  • verdict -- filter by ALLOW, DENY, ESCALATE
  • action_type -- filter by tool/action category
  • since / until -- time range

Response: paginated list of audit records. Consistent with the existing paginated response convention.

Files

  • src/synthorg/security/audit.py -- verify persistence layer supports query
  • src/synthorg/api/controllers/security.py (or new audit.py) -- add route

Metadata

Metadata

Assignees

No one assigned

    Labels

    prio:mediumShould do, but not blockingscope:smallLess than 1 day of workspec:apispec:securityDESIGN_SPEC Section 12 - Security & Approval Systemtype:featureNew feature implementation

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions