What is AgentSecrets?
The Zero-Knowledge Difference
How AgentSecrets Works
Installation
Quick Start
Migrating from .env Files
Migrating from Vault / AWS
Migrating from dotenv-vault
Production Checklist
Credential Exposure
What Zero-Knowledge Means
The Proxy Model
The Three-Layer Model
Environments
Agent Identity
Storage Modes
The No get() Principle
Secret-Level Policies
Cloud Overview & Architecture
The Dual-Engine Model
Cloud Resolver Data Plane
Workload & Agent Tokens
Egress Allowlists & Audit Streams
Cloud REST API Reference
Account (init / login)
Server & Self-Hosting (server)
Docs
Shell Autocompletion
Keychain Auth
Secrets
Environments
Credential Proxy
env Injection
Workspaces & Teams
Projects
Agent Identity
Audit & Governance
Integrations Overview
Claude Desktop
Cursor
OpenClaw
HTTP Proxy (Any)
LangChain (Soon)
CrewAI (Soon)
CI/CD Pipeline
SDK Overview
Python SDK
Python API Reference
Python SDK Manual Testing
JavaScript SDK (Soon)
Ecosystem Overview
Zero-Knowledge MCP Server
Server Overview
5-Layer Architecture
Self-Hosting Guide
Authentication & Keys
Workspaces & Teams
Projects & Scope
Environments
Secrets & Sync Protocol
Agent Identity Resolution
Telemetry & Metrics Engine
Audit Log Sync
API Endpoint Reference
Security Overview
Anti-Impersonation & Process Verification
Encryption Model
Zero-Knowledge Sync
Proxy Security Layers
Threat Model
OWASP Top 10 Mitigation
Security FAQ
Third-Party Audit
Reporting Vulnerabilities
Guides Overview
Building on the SDK
Stripe Integration
OpenAI Integration
Multi-Agent Setup
Onboarding Team
CI/CD Pipeline
Publishing ZK MCP
Rotating Credentials
Auditing Team Activity
Dev to Production
Kubernetes Deployment
Monorepo Setup
Production Proxy Hardening
vs .env Files
vs HashiCorp Vault
vs AWS Secrets Manager
vs dotenv-vault
vs Infisical
When Not to Use
Proxy Not Starting
Proxy Not Resolving
Domain Blocked
Sync Conflicts
MCP Not Connecting
Session Token Errors
Proxy Session Authorization
Keychain Storage & Backends
SSRF & Destination Rules
Installation Issues
Error Codes Reference
Frequently Asked Questions
v3.1.x
v3.0.0
v2.1.0
v2.0.0
v1.4.0
v1.3.x
v1.2.0
v1.1.x
v1.0.x
CLI ReferenceAudit & Governance

Forensic Governance & Audit Logging

In traditional systems, audit logging is treated as a simple event stream—recording what happened (e.g., Agent X called Stripe at 14:22:01, received a 200, took 143ms).

For autonomous AI agents, standard event logging is completely insufficient for security and compliance audits. Because AI agents are non-deterministic, dynamic, and execute untrusted inputs, they require a Forensic Snapshot Log.

AgentSecrets implements a full-governance logging system stored locally in SQLite (~/.agentsecrets/audit.db) that captures the entire security boundary and system state at the exact millisecond of every request.


Why AI Agents Require Forensic Logging

1Non-Deterministic Behavior

AI agents write code, execute shell commands, and construct API requests on the fly based on LLM reasoning. Standard logs only show the end request; they cannot explain why the agent had access to a specific key, or what rules were active when the LLM decided to call that endpoint.

2Rapid Context Shifts

The agent's security context—such as domain allowlists, agent capabilities, or secret policies—can shift dynamically during a session. A forensic audit must prove the exact state of the security boundary when the call was executed, not hours later when the audit is run.

3Log Tampering & Hijacking

If an agent escapes its sandbox or a machine is compromised, attackers may attempt to delete, insert, or reorder log records to hide malicious API calls (e.g. data exfiltration). Without cryptographic non-repudiation, logs cannot be trusted during post-incident investigations.

4Traceable Multi-Layer Enforcement

To satisfy security administrators and compliance auditors (SOC 2, ISO 27001), you must prove exactly which firewall layer authorized or blocked a request. The log must trace evaluations across Agent Capabilities, Workspace Allowlists, and Secret-Level Policies.


The Forensic Log Architecture

AgentSecrets stores all forensic logs locally in a high-performance SQLite database under ~/.agentsecrets/audit.db within the forensic_audit_events table.

To guarantee log integrity, AgentSecrets implements a cryptographic chain hash sequence. Each log entry is mathematically linked to the entry before it:

chain_hash = SHA-256(previous_entry_id + current_entry_id + created_at_RFC3339)
  • Immutable History: If an attacker modifies a row's details, deletes an entry, or tries to reorder logs, the hash chain breaks.
  • Non-Repudiation: Running agentsecrets logs verify walks the chain chronologically, recalculates the hashes, and flags any discrepancy instantly.
  • Zero Credential Exposure: No plaintext credential values are ever written to the database. Only key names (e.g., STRIPE_KEY) and metadata are recorded.

Schema Component Blocks

Every forensic log entry is divided into four highly structured, immutable JSON blocks alongside flat indexable columns:

┌──────────────────────────────────────────────────────────────────┐ │ ForensicAuditEvent │ │ │ │ Flat Fields: id, version, created_at, workspace_id, project_id, │ │ environment, agent_id, token_id, domain, method, │ │ status_code, outcome, latency_ms, chain_hash │ │ │ │ ┌──────────────────┐ ┌──────────────────┐ ┌─────────────────┐ │ │ │ Event Block │ │ Snapshot Block │ │Enforcement Block│ │ │ └──────────────────┘ └──────────────────┘ └─────────────────┘ │ │ │ │ ┌──────────────────┐ │ │ │ Resolution Block │ │ │ └──────────────────┘ │ └──────────────────────────────────────────────────────────────────┘
  1. Event Block: The details of the request execution (timestamp, path, HTTP method, response status code, outcome, latency, and agent token identity).
  2. Snapshot Block: The state of the system at execution time (active allowlist, project configuration, secrets in scope, agent capabilities snapshot, active secret policy, and keychain connection state).
  3. Enforcement Block: The decision path showing the results of each firewall layer checked (Capabilities check, Allowlist check, Secret policy check) and which layer triggered the first failure.
  4. Resolution Block: The post-call handling metrics (style of injection, response scanning status, credential echo detection, redaction replacements, and SSRF validation status).

Log Categories

AgentSecrets separates logs into three distinct categories to cover the entire lifecycle of configuration, security authorization, and runtime credential usage:

CategoryStorage TargetDescriptionHow to Query
Runtime Forensic Audit LogSQLite (~/.agentsecrets/audit.db) & Cloud Backend (Sync)Flat indexable metadata with E2EE-linked JSON snapshots. Tracks all runtime credential usage.agentsecrets logs, agentsecrets proxy logs
Workspace Policy LogSynchronization Server (Cloud Backend)Audit trail of administrative settings changes (e.g., changes to domain allowlists).agentsecrets workspace allowlist log
Keychain Auth Security LogPlaintext File (~/.local/share/keychain-auth/audit.log)Audit trail of secure daemon authorizations, process hash checks, and OS keychain reads.View local audit file
Was this helpful?
Thanks for your feedback!
Your feedback helps us improve the platform.