Fathom
A modern Python-first expert system runtime built on CLIPS. Define rules in YAML. Evaluate in microseconds. Zero hallucinations.
Part of the Kraken stack: Fathom (reasoning engine) · Nautilus (policy data broker) · Stargraph (agent-graph framework).
Current version: 0.13.0
License: MIT
Language: Python 3.12+ (primary), Go and TypeScript SDKs in progress
Package Manager: uv
Maintained by: Kraken Networks
Why Fathom?
Every AI agent framework lets agents decide what to do by guessing. For most tasks, that's fine.
For some tasks, guessing is unacceptable:
- Policy enforcement — "Is this agent allowed to do this?" can't be a maybe.
- Data routing — "Which databases should this query hit?" can't hallucinate a source.
- Compliance — "Did this fleet operate within NIST 800-53 controls?" needs a provable answer.
- Classification — "What clearance level does this data require?" is not a prompt engineering problem.
Fathom provides deterministic, explainable, auditable reasoning using CLIPS — a battle-tested expert system — wrapped in a modern Python library with YAML-first rule authoring.
Install
uv add fathom-rules
Quick Start
from fathom import Engine
# Loads templates/, modules/, functions/, and rules/ from a project directory
engine = Engine.from_rules("policy/")
engine.assert_fact("agent", {
"id": "agent-alpha",
"clearance": "secret",
"purpose": "threat-analysis",
"session_id": "sess-001",
})
engine.assert_fact("data_request", {
"agent_id": "agent-alpha",
"target": "hr_records",
"classification": "top-secret",
"action": "read",
})
result = engine.evaluate()
print(result.decision) # "deny"
print(result.reason) # "Agent clearance is below the data classification (no read up)"
print(result.duration_us) # ~90 (microseconds; varies by machine)
See the Getting Started guide for a full walkthrough.
What Ships Today
Core runtime (Python)
- YAML compiler for templates, rules, modules, and functions
- Forward-chaining evaluation with rule + module traces
- Working memory persistence across evaluations within a session
- Classification-aware operators (
below,meets_or_exceeds,dominates, compartments) - Temporal operators (
count_exceeds,rate_exceeds,changed_within,last_n,distinct_count,sequence_detected) - Rule-assertion actions (
then.assert+bind) and user-defined Python functions (Engine.register_function) - Structured JSON audit log with append-only sinks
- Ed25519 attestation service for signed evaluation results
- Fleet reasoning with Redis and Postgres backends for shared working memory
Integrations
- FastAPI REST server with bearer-token auth and rule-path jailing
- gRPC server with bearer-token auth (see
protos/fathom.proto) - MCP tool server (
FathomMCPServer) for agent discovery - Framework adapters — LangChain callback handler, CrewAI before-tool-call
hook, OpenAI Agents SDK tool guardrail, Google ADK before-tool callback.
Each is allowlist-only: the call proceeds when the decision is exactly
allow, and every other outcome raisesPolicyViolation(ADK returns an error dict instead) - CLI —
fathom validate,fathom compile,fathom test,fathom bench,fathom info,fathom status,fathom verify-artifact,fathom verify-chain,fathom repl - Docker sidecar (Debian slim + uv)
- Prometheus metrics export (
/metricsendpoint) - Policy Studio — browser UI over a real engine, shipped as its own
package (
packages/fathom-studio/, run withuv run fathom-studio). See Running Policy Studio
Rule packs
fathom-owasp-agentic— OWASP Agentic Top 10 mitigationsfathom-nist-800-53— Access control, audit, information flowfathom-hipaa— PHI handling, minimum necessary, breach triggersfathom-cmmc— CMMC Level 2+ controlsfathom-ssvc— SSVC supplier, deployer, and CISA vulnerability-triage trees (144 rules)
SDKs (in progress)
fathom-go— REST + gRPC client (packages/fathom-go/); unit and integration suites run in CI, not yet published to a Go proxyfathom-ts—@fathom-rules/sdk(packages/fathom-ts/); hand-written client covering 4 of the 10 REST endpoints, vitest suite required in CI, not yet published to npm
Integrations that are scaffolded, partial, or planned are catalogued in Planned Integrations.
Core Primitives
| Primitive | Purpose | CLIPS Construct |
|---|---|---|
| Templates | Define fact schemas with typed slots | deftemplate |
| Facts | Typed instances asserted into working memory | working memory |
| Rules | Pattern-matching logic with conditions and actions | defrule |
| Modules | Namespace rules with controlled execution order | defmodule |
| Functions | Reusable logic for conditions and actions | deffunction |
Key Differentiator: Working Memory
Unlike stateless policy engines (OPA, Cedar), Fathom maintains working memory across evaluations within a session:
- Cumulative reasoning — "This agent accessed PII from 3 sources — deny the 4th."
- Temporal patterns — "Denial rate spiked 400% in 10 minutes — escalate."
- Cross-fact inference — "Agent A passed data to Agent B, who is requesting external access — violation."
Integration Shapes
As a library
from fathom import Engine
engine = Engine.from_rules("rules/")
result = engine.evaluate()
As a REST sidecar
docker run -p 8080:8080 -v ./rules:/rules ghcr.io/krakennet/fathom:latest
curl -H "Authorization: Bearer $TOKEN" -X POST localhost:8080/v1/evaluate \
-d '{"facts": [...], "ruleset": "access-control"}'
As a gRPC sidecar
# protos/fathom.proto — regenerate Go/TS clients from the proto
grpcurl -H "authorization: Bearer $TOKEN" \
-d '{"facts": [...]}' localhost:50051 fathom.v1.Fathom/Evaluate
As an MCP tool
from fathom.integrations.mcp_server import FathomMCPServer
server = FathomMCPServer(engine)
server.serve()
Documentation
Docs live under docs/ and build with MkDocs Material (Diátaxis information architecture).
Entry points:
- Getting Started
- Tutorials
- How-to Guides
- Concepts
- Reference
- Configuration — every
FATHOM_*variable and the gRPC TLS setup
Performance Targets
| Operation | Target |
|---|---|
| Single rule evaluation | < 100µs |
| 100-rule evaluation | < 500µs |
| Fact assertion | < 25µs |
| YAML compilation | < 2ms per rule |
Measured by scripts/benchmark.py and enforced on every pull request by CI's
bench job, which fails the build if a median regresses past its target.
Compilation is stated per rule because it scales with pack size: the packaged
SSVC pack is 144 rules. The numbers above are what the benchmark reports on a
developer machine; CI enforces them with a 2x allowance (--slack 2.0)
because GitHub's shared runners measured 1.2x to 1.9x slower than that machine
across five consecutive runs of the same job. Run python scripts/benchmark.py
with no slack to hold your own hardware to the published numbers directly.
Related Projects
- Bosun: Agent governance built on Fathom (fleet analysis, compliance attestation)
- Nautilus: Intelligent data broker built on Fathom (multi-source routing, classification-aware scoping)
- Stargraph: Workgraph, AI orchestration framework built on Fathom
Development
git clone https://github.com/KrakenNet/fathom.git
cd fathom
uv sync --all-extras # --all-extras is required for the full test suite
uv run pytest # engine, integrations, and Studio suites
uv run ruff check src/ tests/ # lint
uv run mypy src/ # type check
uv run pytest --cov=fathom # coverage report
uv run mkdocs serve # docs preview
Run the live REST server locally:
uv run uvicorn fathom.integrations.rest:app --reload
See CONTRIBUTING.md for full development guidelines and CHANGELOG.md for release notes.
Stability
Fathom is pre-1.0. VERSIONING.md names the surfaces that are
covered — fathom.__all__, the YAML authoring keys, the REST/gRPC/MCP
contracts, and the CLI — states what a 0.x minor and patch bump each mean for
them, and defines the deprecation period. The symbol list there is checked
against the package on every test run.
Star History
License
MIT — see LICENSE for details.
Maintained by Kraken Networks · krakennetworks.com · krakn.ai
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file fathom_rules-0.13.0.tar.gz.
File metadata
- Download URL: fathom_rules-0.13.0.tar.gz
- Upload date:
- Size: 2.7 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8eb03f60b5aaa00baabd050c4f0c263aab6e557a8e10648c19a2796600f00317
|
|
| MD5 |
59433bc17c31e526d87ec2f72e45cdff
|
|
| BLAKE2b-256 |
a96fa7bed4791c03f97c57a16653fa990dcc01adb0d183ec85d4343e63e1e7f8
|
Provenance
The following attestation bundles were made for fathom_rules-0.13.0.tar.gz:
Publisher:
pypi-publish.yml on KrakenNet/fathom
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
fathom_rules-0.13.0.tar.gz -
Subject digest:
8eb03f60b5aaa00baabd050c4f0c263aab6e557a8e10648c19a2796600f00317 - Sigstore transparency entry: 2772087573
- Sigstore integration time:
-
Permalink:
KrakenNet/fathom@d43091425b067b02f92de803a7dccc34bedf85c8 -
Branch / Tag:
refs/tags/v0.13.0 - Owner: https://github.com/KrakenNet
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi-publish.yml@d43091425b067b02f92de803a7dccc34bedf85c8 -
Trigger Event:
push
-
Statement type:
File details
Details for the file fathom_rules-0.13.0-py3-none-any.whl.
File metadata
- Download URL: fathom_rules-0.13.0-py3-none-any.whl
- Upload date:
- Size: 1.8 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
31ad15219474adc321185b62e1429d8c8e0d3afc5f82ce96a95545e8be81e48a
|
|
| MD5 |
1d1df15df7cf326bc19c42e3fc64d41c
|
|
| BLAKE2b-256 |
675ce379be37c59f433df255e6390e8ba0e1941fc8584909bab1642d47758556
|
Provenance
The following attestation bundles were made for fathom_rules-0.13.0-py3-none-any.whl:
Publisher:
pypi-publish.yml on KrakenNet/fathom
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
fathom_rules-0.13.0-py3-none-any.whl -
Subject digest:
31ad15219474adc321185b62e1429d8c8e0d3afc5f82ce96a95545e8be81e48a - Sigstore transparency entry: 2772087672
- Sigstore integration time:
-
Permalink:
KrakenNet/fathom@d43091425b067b02f92de803a7dccc34bedf85c8 -
Branch / Tag:
refs/tags/v0.13.0 - Owner: https://github.com/KrakenNet
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi-publish.yml@d43091425b067b02f92de803a7dccc34bedf85c8 -
Trigger Event:
push
-
Statement type: