---
title: "audit export"
description: "Export agent audit logs as CSV"
canonical: "https://pgbeam.com/docs/cli/audit/export"
last-updated: "2026-10-08T10:00:49.000Z"
---

# audit export

> Export agent audit logs as CSV

URL: https://pgbeam.com/docs/cli/audit/export

Stream the linked project's agent audit entries as a CSV file, newest first, honoring the same credential, event, decision, source, and date-range filters as `audit list`. The full filtered set is streamed (no pagination), suitable for spreadsheets, SIEM ingestion, and compliance archives. Writes to stdout by default, or to a file with `--output`. The API emits CSV only; the wire/mcp/rest/control-formatted views are selected with `--source`, not a separate output format.

## Usage

## Options

Option

Description

Required

Default

`--credential <value>`

Filter to one agent credential ID

No

-

`--event <value>`

Filter to one event type (e.g. blocked, masked, query)

No

-

`--decision <value>`

Coarse outcome filter: allow, block, mask, or truncate

No

-

`--source <value>`

Filter by statement origin: wire, mcp, rest, or control

No

-

`--start <value>`

Return entries at or after this ISO 8601 timestamp (inclusive lower bound)

No

-

`--end <value>`

Return entries strictly older than this ISO 8601 timestamp (upper bound)

No

-

`--output <value>`, `-o`

Write the CSV to this file instead of stdout

No

-

All global options (`--token`, `--profile`,
`--project`, `--org`, `--json`, `--no-color`, `--no-trunc`, `--debug`) are
also available on this command.

## Examples

## Output

Writes CSV to stdout, or to the file named by --output (with a confirmation message). Columns include id, ts, event, source, credential_id, decision_rule, sql, and more.