godelgate Book a demo

Audit log

What Godelgate records for every call, and how to query it.

Every tool call is written to the calls table of the Godelgate SQLite database (GODELGATE_DB, default data/godelgate.db) before anything else happens, then updated when it finishes.

#What's recorded

ColumnDescription
idCall ID (also the approval ID)
tsWhen the call arrived, in milliseconds since the Unix epoch
userUser name from the key
sessionMCP session ID
toolNamespaced tool name
argsArguments, redacted (see below)
labelsThe tool's trifecta labels
decisionallow, deny or approve
reasonWhy: the rule, the trifecta explanation, quarantine or default policy
statusSee Call statuses
duration_msTime spent in the upstream call
resultThe tool's result, redacted, or the error message
approved_byWho approved or rejected, or timeout

#Redaction

Arguments and results are stored redacted, so the log is useful for investigations without becoming a second copy of your data:

  • Values under keys that look like secrets (password, secret, token, api_key, auth, credential, case-insensitive) become [redacted].
  • Strings longer than 400 characters are cut, with their original length noted.
  • Arrays keep their first 50 items, and nesting stops at 6 levels.

#Querying

The database is a plain SQLite file. For example, everything the trifecta blocked in the last day:

bash
sqlite3 /data/godelgate.db "
  SELECT datetime(ts / 1000, 'unixepoch'), user, tool, reason
  FROM calls
  WHERE status = 'denied' AND reason LIKE 'lethal trifecta%'
    AND ts > (strftime('%s', 'now') - 86400) * 1000
  ORDER BY ts DESC;"

Every call by one user, newest first:

bash
sqlite3 /data/godelgate.db "SELECT * FROM calls WHERE user = 'alice' ORDER BY ts DESC LIMIT 50;"

#Live stream

The admin event stream sends each call as it's recorded and updated. See HTTP API.

#Retention

Godelgate never deletes audit rows. Back up the database file, and prune old rows with SQL if you need to.