Epigenetic Profiles
Like epigenetics in biology — the genome (strand) stays intact, only the expression changes. Epigenetic Profiles are named behavioral configurations that change how an agent handles reads, writes, and semantic queries. Switch modes in a single API call; every switch is cryptographically audited on the strand.
The Five Profiles
Every SapixDB agent has exactly five built-in profiles. They cannot be deleted or renamed; you switch between them via a single API call. The default profile is always the starting state on boot.
defaulthigh_loadcomplianceanalyticsmaintenanceAutomatic High Load detection
A background task runs every 60 seconds comparing writes_total snapshots. When write rate crosses the threshold, high_load activates automatically. When load drops, it reverts — but only if the activation was metric-triggered. Manual activations are never auto-reverted.
metric_triggered: true). If you manually switch to high_load (or any other profile), the monitor will not override it — you must revert manually.HTTP API
List all profiles
{
"profiles": [
{
"name": "default",
"display_name": "Default",
"description": "Standard read/write behavior. No restrictions.",
"color": "#a6e3a1",
"allow_writes": true,
"allow_reads": true,
"skip_llm": false,
"force_audit_on_read": false
},
{ "name": "high_load", "allow_writes": true, "skip_llm": true, ... },
{ "name": "compliance", "force_audit_on_read": true, ... },
{ "name": "analytics", "allow_writes": false, "skip_llm": false, ... },
{ "name": "maintenance", "allow_writes": false, "skip_llm": true, ... }
]
}Get active profile
{
"active": "compliance",
"activated_at_ms": 1747003200000,
"activated_by": "[email protected]",
"reason": "SOC 2 audit window",
"metric_triggered": false,
"config": {
"name": "compliance",
"display_name": "Compliance",
"allow_writes": true,
"allow_reads": true,
"skip_llm": false,
"force_audit_on_read": true,
"color": "#89b4fa"
}
}Activate a profile
{
"profile": "compliance",
"activated_by": "[email protected]",
"reason": "SOC 2 audit window"
}
// → same shape as GET /v1/epigenetics/profile
// → 400 Bad Request for unknown profile namesdefault · high_load · compliance · analytics · maintenanceAny other value returns
400 Bad Request.Activation history
{
"history": [
{
"profile": "default",
"activated_at_ms": 1747000000000,
"activated_by": "system",
"reason": null
},
{
"profile": "high_load",
"activated_at_ms": 1747001800000,
"activated_by": "metric-monitor",
"reason": null
},
{
"profile": "compliance",
"activated_at_ms": 1747003200000,
"activated_by": "[email protected]",
"reason": "SOC 2 audit window"
}
]
}Audit strand
Every profile activation is appended to the agent's strand as a BlockFlags::EPIGENETICS nucleotide (bit 4 · 0x10). This makes the governance history cryptographically immutable — you can verify exactly when each profile was active by replaying the chain. The history endpoint returns the in-memory view; the strand is the authoritative tamper-evident record.
Python
pip install sapixdb-epigenetics
import asyncio
from sapixdb_epigenetics import EpiClient, EPI_COMPLIANCE, EPI_DEFAULT
async def main():
async with EpiClient("http://localhost:7475") as epi:
# Show all available profiles
all_profiles = await epi.list_profiles()
for p in all_profiles.profiles:
writes = "✓" if p.allow_writes else "✗"
llm = "✓" if not p.skip_llm else "✗"
audit = "✓" if p.force_audit_on_read else "✗"
print(f"{p.display_name:<14} writes={writes} llm={llm} audit={audit}")
# Enter compliance mode for a regulated window
active = await epi.activate(
EPI_COMPLIANCE,
activated_by="[email protected]",
reason="SOC 2 type II audit — 72h window",
)
print(f"\nNow active: {active.active}")
print(f"Audit on read: {active.config.force_audit_on_read}")
# Quick predicate helpers
is_restricted = await epi.is_restricted()
can_write = await epi.profile_allows_writes()
print(f"Restricted: {is_restricted} Can write: {can_write}")
# Inspect recent switches
hist = await epi.history()
for entry in hist.history[-3:]:
print(f" {entry.profile:<14} ← {entry.activated_by}")
# Revert to default
await epi.activate(EPI_DEFAULT, activated_by="[email protected]")
asyncio.run(main())EpiClient API
sapixdb-agent, SapixClient exposes thin raw-dict wrappers — epi_profiles(), epi_profile(), epi_activate(profile, activated_by, reason), and epi_history(). Use sapixdb-epigenetics for typed Pydantic models and the higher-level convenience helpers.Mutants propose schema changes and self-healing actions — governed by the same human approval chain that protects your strands.