About Fable Mode
Fable Mode is an open-source control plane for AI coding agents that gates workspace writes behind timed deliberation, evidence, and adversarial review. It provides an MCP server and an optional Agent Skill, with the same package also supporting direct JSON transport.
Key features
- 01Time-locked deliberation before writing
- 02Evidence receipts and invariants
- 03Five-vector red-team review
- 04Sealed record of verification
- 05Optional AI evidence adjudication
Use cases
- 01Gate workspace writes during a coding task
- 02Require evidence for an agent's claims
- 03Red-team code before allowing changes
MCP support
Its stdio MCP server lets clients manage sessions and inspect status through tools such as `fable_session`. The package also supports direct JSON transport without an MCP host.
Configuration
Local server config is the same for every client. Copy it into your client’s MCP config file.
Tools
14Saved tool list · updated 2w ago
| Parameter | Type | Required | Description |
|---|---|---|---|
| tag | enum | No | Epistemic classification tag for truth calibration.PROVEN | HYPOTHESIS | UNKNOWN |
| code | string | No | Source code content (HTML, JSX, CSS, or TSX) to audit or validate against anti-slop gates. |
| name | string | No | Name identifier for automation pipeline spec. |
| tree | object|array|string | No | Tree hierarchy adjacency list or nested dict for hyperbolic embedding. |
| claim | string | No | Fact, hypothesis statement, or unknown parameter to track in epistemic ledger. |
| edges | array|string | No | List of directed edge dictionaries for Causal DAG construction. |
| gamma | number | No | Policy precision inverse temperature gamma for Active Inference softmax (default 16.0). |
| label | string | No | Optional label or description for compressed CAS node. |
| nodes | array|string | No | List of node dictionaries for Causal DAG construction. |
| action | enum | Yes | The Fable session action to perform.create_session | set_timer | get_status | telemetry | advance_phase | log_epistemic_item | record_invariant | log_refinement_cycle | unlock_execution | checkpoint_session | restore_session | list_sessions | compile_delegation_contract | compress_payload | decompress_payload | view_slice | accumulate_payload | flush_accumulator | get_compression_stats | system3_dialectical_synthesis | system3_causal_simulate | system3_evolve_paradigms | system3_induce_axioms | system3_meta_reflect | system3_tri_level_orchestrate | system3_hyperbolic_embed | system3_kripke_verify | system3_active_inference | system3_proof_oracle | track_file_change | get_session_lineage | inspect_plan | verify_proof | record_visual_mockups | validate_event_history | set_goal_rubric | evaluate_goal_rubric | get_goal_rubric | register_automation_pipeline | red_team_code_review | record_breakage_report | verify_red_team_remediation | cortical_define_lobe | cortical_list_lobes | check_auto_update | apply_auto_update | evolve_cortex | audit_anti_slop | infer_design_brief | generate_design_tokens | generate_awwwards_scaffold | validate_preflight_design | list_design_archetypes | scrape_web | scrape_youtube | scrape_reddit | scrape_x | scrape_github | scrape_arxiv |
| axioms | array|string | No | List of reference axiom names or strings for proof oracle. |
| domain | string | No | Domain boundary for the invariant or cortical plasticity consolidation. |
| states | array|string | No | List of hidden state identifiers for Active Inference POMDP. |
| target | string | No | Target URL, ID, subreddit, repo, paper ID, handle, or search query string for research scraping actions. |
| worlds | array|string | No | List of world/state definitions for Kripke structure. |
| actions | array|string | No | List of control action identifiers for Active Inference POMDP. |
| cas_ref | string | No | CAS reference URI (cas://<sha256_hex>) or 64-char hash. |
| content | string | No | Raw text content or payload to store/compress into Content-Addressed Storage (CAS). |
| context | object|string | No | Hypothesis typing context dictionary {name: type} for proof oracle. |
| d_prior | array|string | No | Prior initial state belief distribution D for Active Inference. |
| formula | string | No | CTL / modal formula string to verify against Kripke structure (e.g. 'AG(safe)', 'EF(goal)'). |
| mockups | array|string | No | List of concept dictionaries for visual mockup recording. |
| payload | string | No | Micro-payload text for adaptive batch accumulator or CAS storage. |
| root_id | string | No | Root node ID for hyperbolic tree embedding or initial world. |
| task_id | string | No | Task identifier for cortical plasticity consolidation or session lineage. |
| a_matrix | array|string | No | Observation likelihood matrix A [O x S] for Active Inference. |
| criteria | array|string|object | No | List of criteria pointers or JSON string of rubric items for goal score evaluation. |
| end_line | integer | No | Ending line number (1-indexed inclusive) for windowed line slice viewing. |
| evidence | string | No | Source file, command output, line number, or URL supporting the claim. |
| metadata | object | No | Optional metadata dictionary attached to accumulated micro-payload. |
| policies | array|string | No | List of candidate action sequence policies for Expected Free Energy evaluation. |
| archetype | enum | No | Haute aesthetic archetype identifier for design tokens or scaffolding.cyber_obsidian_monolith | haute_editorial_modernism | swiss_precision_vignelli | kinetic_spatial_hud | neo_nordic_warmth | cold_chromatic_luxury |
| base_step | number | No | Base geodesic step distance for hyperbolic tree embedding (default 1.0). |
| curvature | number | No | Sectional curvature c > 0 of Poincaré manifold (default 1.0). |
| dimension | integer | No | Dimension of Poincaré ball manifold (default 2). |
| file_path | string | No | Target file path for file change tracking or proof verification. |
| objective | string | No | High-level goal or problem statement for the reasoning session. |
| rationale | string | No | Justification for unlocking code execution after satisfying cognitive gates. |
| rubric_id | string | No | Identifier of the goal rubric. |
| b_matrices | object|string | No | State transition matrices B [Action -> S x S] for Active Inference. |
| focus_area | string | No | Specific subsystem, component, algorithm, or interface being critically re-evaluated. |
| model_name | string | No | Name for the causal DAG model in System 3 simulation. |
| next_phase | enum | No | Target phase to advance the session into.Phase 1: Epistemic Grounding & Live Research | Phase 2: Invariant Specification & Blueprint | Phase 3: Adversarial Red-Teaming & Falsification | Phase 4: Subagent Fleet Delegation | Phase 5: Multi-Tier Verification & Gatekeeping | Phase 6: Final Walkthrough & Reporting |
| proof_type | enum | No | Deterministic proof type.ast | receipt | file_sha256 | formal_logic | vector_coordinates |
| start_line | integer | No | Starting line number (1-indexed inclusive) for windowed line slice viewing. |
| change_type | enum | No | Classification of file change.modified | created | deleted | slated |
| evaluations | array|object|string | No | Alias for item_evaluations: list or dict of criterion evaluation updates. |
| force_flush | boolean | No | Force flush buffered micro-payloads immediately into a composite frame. |
| generations | integer | No | Number of evolutionary generations to run (default 3). |
| node_labels | object|string | No | Optional mapping of node IDs to readable labels. |
| observation | string | No | Current sensory observation for Active Inference belief updating. |
| target_code | string | No | Source-code string input. Dynamic target execution from source-code strings is disabled and requires a separate sandboxed executor. |
| target_name | string | No | Identifier or name of the target module, class, or function for red-team review. |
| transitions | array|object|string | No | List of transitions or adjacency dictionary for Kripke structure. |
| user_prompt | string | No | Alias for prompt: high-level design prompt describing desired web experience. |
| code_snippet | string | No | Alternative alias for source-code string input. Dynamic target execution from source-code strings is disabled and requires a separate sandboxed executor. |
| diff_summary | string | No | Concise summary of file changes, diff, or slated edits. |
| observations | array|string | No | List of observation identifiers for Active Inference POMDP. |
| prior_report | object|string | No | Prior red-team breakage report dictionary or JSON string to verify remediation against. |
| session_name | string | No | Unique identifier / name for the Fable session. |
| target_score | number | No | Target composite goal score threshold (default 0.95, min 0.0, max 1.0). |
| thesis_title | string | No | Title of the thesis paradigm for System 3 dialectical synthesis. |
| artifact_path | string | No | Absolute filesystem path to blueprint artifact, proof, or benchmark script documenting the refinement. |
| c_preferences | array|string | No | Prior preference distribution C over observations for Active Inference. |
| evaluator_cmd | string | No | Alias for evaluator_command: shell command or tool invocation for candidate evaluator. |
| failure_count | integer | No | Historical failure count for tri-level cognitive gear arbitration. |
| failure_modes | array|string | No | List of adversarial failure modes identified in critique. |
| generator_cmd | string | No | Alias for generator_command: shell command or tool invocation for candidate generator. |
| initial_world | string | No | Initial world ID for Kripke model checking. |
| interventions | object|string | No | Dictionary of Pearl's do-operator interventions: {node_id: value}. |
| mutation_rate | number | No | Genetic mutation rate probability (default 0.15). |
| phase_summary | string | No | Concise summary of findings or deliverables completed in the previous phase. |
| pipeline_name | string | No | Alternative alias for automation pipeline name. |
| pipeline_type | string | No | Type of autonomous pipeline (default 'closed_loop'). |
| target_metric | string | No | Target KPI node ID for sensitivity and structural brittleness analysis. |
| contradictions | array|string | No | List of parameter trade-offs / contradictions to resolve with TRIZ principles. |
| crossover_rate | number | No | Genetic crossover rate probability (default 0.80). |
| dials_override | object | No | Optional discrete dials override: variance (1-10), motion (1-10), density (1-10). |
| invariant_name | string | No | Identifier or title of the formal invariant (e.g., 'INV-01: Zero-Deadlock Ring Buffer'). |
| max_iterations | integer | No | Maximum closed-loop iterations before halting (default 10). |
| seed_paradigms | array|string | No | Optional list of initial paradigm definitions to seed the gene pool. |
| task_objective | string | No | Task objective or target outcome for goal scoring rubric. |
| population_size | integer | No | Population size for evolutionary gene pool (default 12). |
| refinement_type | string | No | Type of rethink-refine cycle (e.g. 'archetype_exploration', 'triz_resolution', 'adversarial_falsification', 'benchmark_probe', 'failure_mode_analysis'). |
| remediated_code | string | No | Remediated source-code string input. Dynamic target execution from source-code strings is disabled and requires a separate sandboxed executor. |
| subagent_prompt | string | No | The delegation prompt or contract text for the subagent to validate. |
| target_resource | string | No | Target resource (file path, receipt ID) for proof verification. |
| task_complexity | number | No | Task complexity index [0.0, 1.0] for tri-level cognitive arbitration. |
| antithesis_title | string | No | Title of the antithesis / adversarial critique. |
| broken_scenarios | array|string | No | List or JSON string of broken attack scenarios found during red-team review. |
| formal_statement | string | No | Mathematical or formal contract specification that must never be violated. |
| item_evaluations | array|object|string | No | Item evaluations mapping, list, or JSON string with pointer_id, satisfied, score, evidence_receipt_id. |
| selected_concept | string | No | Identifier of the selected visual concept archetype. |
| target_threshold | number | No | Target threshold score for pipeline iteration termination (default 0.95). |
| custom_hypotheses | array|string | No | List or JSON string of custom adversarial hypotheses / attack vectors. |
| evaluator_command | string | No | Shell command or tool invocation for candidate evaluator. |
| generator_command | string | No | Shell command or tool invocation for candidate generator. |
| max_debate_rounds | integer | No | Maximum number of dialectical debate rounds for synthesis (default 4). |
| objective_weights | object|string | No | Optional dictionary of weights across the 10 Pareto dimensions. |
| archetype_override | string | No | Optional override for Haute aesthetic archetype. |
| auto_log_epistemic | boolean | No | Whether to automatically record retrieved research findings as a [HYPOTHESIS] candidate item in Fable Session's epistemic ledger for subsequent cross-verification. |
| proof_or_rationale | string | No | Proof sketch, rationale, or inductive argument establishing the invariant. |
| thesis_description | string | No | Core architecture description and assumptions for the thesis candidate. |
| affected_invariants | array|string | No | List or string of invariant names affected by this file change. |
| time_budget_minutes | number | No | Immutable outer authority budget in minutes. set_timer can only change the internal pacing timer. |
| include_line_numbers | boolean | No | Whether to format line slice with line numbers. |
| contradiction_density | number | No | Contradiction density index [0.0, 1.0] for cognitive gear shifting. |
| epistemic_uncertainty | number | No | Epistemic uncertainty index [0.0, 1.0] for arbitration. |
| critique_or_bottleneck | string | No | Critical flaw, vulnerability, edge case, memory/latency bottleneck, or assumption scrutinized. |
| terminal_probe_results | string | No | Live empirical probe output, benchmark figures, latency numbers, or profiling stats supporting the refinement. |
| architectural_refinement | string | No | Concrete architectural evolution, optimization, or algorithm change derived from the critique. |
| target_residual_threshold | number | No | Target residual contradiction score threshold for convergence (default 0.15). |
Details
From the project READMEFable Mode is an open-source control plane for AI coding agents.
It makes an agent deliberate, produce evidence, and survive adversarial review before it earns permission to write to your workspace. The gates are mechanical, not prompt advice: no timer, no proof, no write access.
Demo
KERR // ORRERY
One self-contained HTML file. Raw WebGL, zero libraries, zero external assets, and zero build step.
https://github.com/user-attachments/assets/8287bbfe-e3ee-4dcf-ba0f-f9ff22ae79bd
7 renders rejected before final · 2 bugs caught · 10/10 red-team probes passed
Fable Mode overview
https://github.com/user-attachments/assets/27f4f8a2-b1bb-4398-a08c-bc9fd93d69d7
Quick start
A session starts locked. Confidence does not unlock it.
- Install the MCP server using one of the options below.
- Add the optional Agent Skill if you want the full workflow.
- Ask your agent to use Fable Mode for a concrete coding task and choose a time budget.
A new session starts with execution locked:
{
"action": "create_session",
"session_name": "demo-refactor",
"objective": "Refactor the parser without changing public behavior",
"time_budget_minutes": 2
}
The agent then records evidence and an invariant. An early unlock_execution
request is rejected until the authority timer and proof prerequisites pass.
Use get_status at any point to see the active phase, remaining time, evidence
counts, and lock state.
The same gates guard every phase: evidence receipts for claims, a five-vector red-team swarm for code, and a sealed record of what was verified.
One package, two agent environments
Fable ships as one PyPI package. The same package contains the runtime, stdio MCP server, and complete Agent Skill. Setup is explicit so installing an MCP server never silently activates workspace instructions.
Run setup from the project the agent will work in:
uvx --from fable-engine==1.3.9 fable-mode setup --yes
This resolves the pinned package in an isolated uv environment and copies the
bundled skill to .agents/skills/fable-mode. Use --dry-run to preview or
--target <dir> for another skill directory. For a persistent install, use:
python -m pip install fable-engine
fable-mode setup --yes
Then choose only the invocation that matches the agent environment.
Native MCP client
Run fable-engine as the stdio server. For example:
// Claude Code: claude mcp add fable-engine -- uvx --from fable-engine==1.3.9 fable-engine
// Cursor or another JSON-configured client:
{
"mcpServers": {
"fable-engine": {
"command": "uvx",
"args": ["--from", "fable-engine==1.3.9", "fable-engine"]
}
}
}
Shell sandbox with internet, no MCP host
The same package exposes a direct JSON transport. Pipe one fable_session
argument object to fable-mode call:
printf '%s\n' '{"action":"create_session","session_name":"demo","objective":"Verify this change","time_budget_minutes":2}' \
| uvx --from fable-engine==1.3.9 fable-mode call
The command uses JSON Lines: one fable_session argument object per input line
and one JSON result per output line. Keep that process open for a full workflow so
the authority timer and session stay in the same trusted runtime. A one-line pipe
is useful for a single inspection call. Each uvx command can resolve an
isolated environment; pip install is better when the sandbox keeps a Python
environment between calls. Session data persists outside that environment in
Fable's data directory (FABLE_DATA_DIR can override it).
Python 3.10+, zero runtime dependencies. Published on PyPI as fable-engine.
Skill activation remains explicit
setup is the unified path. The older install-skill command remains as a
compatible alias for skill-only installation. Neither fable-engine nor
pip install fable-engine writes instructions into a workspace on its own.
How it works
- Think — Time-locked deliberation. The agent cannot write until the timer ends.
- Prove — Claims need real evidence (tool receipts, hashes, invariants).
- Attack — A red-team swarm tries to break the code.
- Write — Only then is the workspace unlocked.
Optional: AI evidence adjudicator
The evidence in a session is written by an AI agent, so Fable can optionally ask an external reviewer model to audit that evidence before the workspace unlocks. Stdlib-only, one bounded HTTPS call, no local model, no extra RAM to speak of. Off by default; fail-closed when enforcing. It raises the cost of fabricated proof - it cannot guarantee deception is impossible, and the mechanical gates stay the primary authority. Setup and honest limits: AI evidence adjudicator.
What it is not
- Not a claim of flawless code. It is a checkable workflow, not a guarantee.
- Not a bigger prompt. The locks are enforced by the engine, not by wording.
- Not a framework lock-in. It speaks MCP and runs beside your current agent.
Docs
- Start here: practical guide
- Agent Skill reference
- V1 → V2 migration
- V2 architecture
- System 3 (experimental)
- AI evidence adjudicator (optional)
Contributing
Issues and pull requests are welcome. See CONTRIBUTING.md.
MIT License · Built by REX
Comments
New to MCP?
From what the protocol is to installing your first server, these answers cover most first questions.
An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.