Skip to main content
This guide covers everything you need to deploy Attesta in a production environment — from YAML configuration to audit log persistence, trust engine tuning, performance optimization, and monitoring. Start with this production-ready configuration and adjust to your needs:
attesta.yaml
Use Attesta.from_config("attesta.yaml") to load this configuration. The rich format (with policy:, risk:, trust: sections) automatically initializes the trust engine, domain scorer, audit logger, and terminal renderer.

Fail Modes

The fail_mode setting controls behavior when the approval system is unavailable (renderer crash, timeout, network failure):
Never use fail_mode: allow in production. If the approval system goes down, all actions would bypass human oversight.

Audit Log Persistence

Attesta supports two audit backends:
  1. Legacy backend (default) — Built-in SHA-256 hash-chained JSONL logger
  2. TrailProof backend — Enhanced features including HMAC signing and multi-tenancy
Both backends write to JSONL files. For production, you need durable persistence.

Option 1: Local JSONL with Rotation

The simplest approach — write to a local file and rotate with logrotate or a similar tool.
attesta.yaml
logrotate config
When using copytruncate, the hash chain resumes correctly because the audit logger reads the last entry’s hash on startup. However, the chain integrity check (verify_chain() or verify()) should be run on each rotated file individually.
For enhanced audit features like HMAC signing and multi-tenancy, consider using the TrailProof backend. See the TrailProof Integration Guide for details.

Option 2: PostgreSQL Audit Logger

For queryable, durable audit storage, implement a database-backed logger:
Database schema:

Option 3: Cloud Storage (S3 / GCS)

For compliance-heavy environments, write audit logs to immutable cloud storage:
Enable S3 Object Lock in compliance mode to make audit entries truly immutable. This satisfies SOC-2, HIPAA, and PCI-DSS requirements for tamper-proof audit trails.

Trust Engine Tuning

The trust engine adjusts effective risk scores based on agent history. Getting the parameters right is critical for balancing security with usability.

Parameter Reference

Tuning Strategies

For high-security environments (finance, healthcare):
Agents start with very low trust, the ceiling is restrictive, trust decays faster, and the maximum risk discount is small.

Monitoring Trust

Use the CLI to inspect trust scores:
Programmatically:
The trust engine has a critical safety invariant: CRITICAL-level actions are never downgraded by trust, regardless of how trusted the agent is. This ensures that the most dangerous actions always require full verification.

Performance Considerations

Scorer Performance

The DefaultRiskScorer is fast (sub-millisecond) and suitable for high-throughput environments. Custom scorers that involve I/O (database lookups, ML model inference) add latency.

Audit Logger Performance

The JSONL file logger is append-only and fast. For high-volume environments:

Renderer Latency

The renderer is the primary source of latency since it waits for human input. For non-blocking architectures:
  1. Use Attesta.evaluate() with an async renderer that returns immediately with a pending status
  2. Process the approval asynchronously and execute the action when approved
  3. Set timeout_seconds to prevent indefinite blocking

Monitoring and Alerting

Key Metrics to Track

Rubber Stamp Detection

The built-in audit logger provides a method to find suspiciously fast approvals:

Audit Chain Verification

Run chain verification as a scheduled check:

Prometheus Metrics Example


Deployment Checklist

1

Configure attesta.yaml

Set fail_mode: deny, configure minimum review times, and set up risk overrides for your most dangerous actions.
2

Set Up Persistent Audit Logging

Choose a durable storage backend (PostgreSQL, S3, or JSONL with rotation) and configure the audit logger.
3

Configure the Renderer

Specify an explicit renderer. Do not rely on auto-detection in production containers.
4

Tune the Trust Engine

Start with the balanced preset and adjust based on your organization’s risk tolerance.
5

Set Up Monitoring

Track approval rates, rubber stamp frequency, review times, and audit chain integrity.
6

Run Integration Tests

Verify the full pipeline with your production configuration using mock renderers (see the Testing Guide).
7

Schedule Audit Verification

Run verify_chain() daily and alert on any broken links.

attesta.yaml Reference

Full configuration file reference

Testing Guide

Testing patterns for gated functions

TrailProof Integration

Enhanced audit backend with HMAC signing

Audit Trail Concepts

Understand tamper-proof audit logging