Skip to main content

Configuration

MemproofConfig is a Pydantic BaseModel that holds all configuration for a Memproof instance. You can construct it directly, pass individual keyword arguments to the Memproof constructor, or load defaults from environment variables using load_config().

MemproofConfig

Fields

Core

str
default:"\"memproof.yaml\""
Path to the Memproof policy YAML file. This file defines the rules, risk thresholds, and actions that govern memory operations. The path is resolved relative to the current working directory unless an absolute path is provided.
str
default:"\"in_memory\""
Which memory adapter backend to use. This determines where memories are physically stored.Supported values:

Attesta Approval Service

These fields configure the external Attesta approval service, which handles human-in-the-loop approval workflows when the policy engine returns a require_approval decision.
bool
default:"False"
Enable integration with the Attesta approval service. When False, approval requests are handled by the local ApprovalBroker without an external service.
str
default:"\"\""
Base URL of the Attesta approval service (e.g., "https://attesta.example.com/api/v1"). Only used when attesta_enabled=True.
str
default:"\"\""
Bearer token for authenticating requests to the Attesta service. Only used when attesta_enabled=True.

Trailproof Audit Trail

These fields configure the Trailproof-powered audit trail that records every step of every memory operation for auditing and compliance. Trailproof provides SHA-256 hash chains, HMAC signing, and tamper detection.
str
default:"\"memory\""
Trailproof audit trail storage backend.
str | None
default:"None"
File path for the JSONL trail store. Required when trail_store="jsonl". The file is created automatically if it does not exist.
str | None
default:"None"
HMAC-SHA256 secret key for signing trail events. When provided, each event in the audit trail includes a cryptographic signature that can be verified later to detect tampering. This should be a strong, random secret kept outside of version control.

Adapter Backends

These fields provide connection details for the supported adapter backends. Only the fields relevant to the selected adapter value need to be configured.
str
default:"\"\""
Base URL for the LangGraph checkpoint API (e.g., "https://langgraph.example.com"). Required when adapter="langgraph".
str
default:"\"\""
API key for authenticating with the LangGraph checkpoint API. Used when adapter="langgraph".
str
default:"\"\""
OpenAI API key. Required when adapter="openai_sessions".
str
default:"\"\""
OpenAI organization ID. Optional, used when adapter="openai_sessions" to scope requests to a specific organization.
str
default:"\"\""
URL of the MCP memory server (e.g., "http://localhost:8200"). Required when adapter="mcp".

Constructing a Config

Direct Construction

Passing to Memproof

Using Convenience kwargs

If you do not need a separate config object, pass the fields directly to the Memproof constructor:

load_config()

Load a MemproofConfig from environment variables with sensible defaults. Every field maps to an environment variable with the MEMPROOF_ prefix.
MemproofConfig
A fully populated configuration object.

Environment Variable Mapping

Boolean fields accept "true" or "false" (case-insensitive). Numeric fields are parsed as floats.

Example


Configuration Precedence

When constructing a Memproof instance, configuration is resolved in the following order:
  1. Explicit config parameter — If a MemproofConfig is passed to the constructor, it is used directly. All keyword arguments (except policy_schema_path) are ignored.
  2. Constructor keyword arguments — If no config is passed, a MemproofConfig is built from the keyword arguments with their defaults.
  3. load_config() — Reads from environment variables. You must call it explicitly and pass the result as the config parameter.