Encoding the world's rules
Rule Atlas builds open, machine-readable encodings of statutes, regulations, and policy rules. Ground truth for AI systems. Verifiable by design.
Atlas
The open platform for exploring encoded law. Browse the Archive of source documents, RAC encodings, and validation results across jurisdictions.
Federal statutes
53 USC titles • 82,854 sections • 160,360 cross-references
IRS guidance
148 Rev. Procs • 105 Rev. Rulings • 317 Notices
State codes
48 states archived • NY, CA, DC with full section data
Regulations
CFR titles, Treasury regulations, agency rules — coming soon
Rules as Code
A domain-specific language for encoding rules with auditability, temporal versioning, and legal citations built in.
(a) In general.— There is hereby
imposed a tax equal to 3.8 percent
of the lesser of net investment
income or modified AGI in excess
of the threshold amount.
from 2013-01-01: 0.038
imports:
- 26/1411/a#net_investment_income
- 26/1411/a#excess_magi
entity: TaxUnit
from 2013-01-01:
niit_rate * min(net_investment_income, excess_magi)Self-contained
One file captures statute text (as comments), parameters, and formulas. Parsed into a typed AST, compiled to IR, executed or compiled to native Rust.
Legally grounded
File paths mirror legal citations. Every value traces back to statute. No magic numbers allowed.
Temporal versioning
Track how law changes over time. Every definition uses from clauses with effective dates.
.rac
Self-contained statute encoding format. One file captures the law: statute text, parameters, and computed values.
# 26 USC 1411(a) - Net Investment Income Tax
# (a) In general.— There is hereby imposed a tax equal
# to 3.8 percent of the lesser of— (1) net investment
# income, or (2) modified AGI in excess of the
# threshold amount.
# "3.8 percent"
from 2013-01-01: 0.038
# Lesser of NII or excess MAGI over threshold
imports:
- 26/62#modified_agi
- 26/1411/b#threshold_amount
entity: TaxUnit
from 2013-01-01: max(0, modified_agi - threshold_amount)
imports:
- 26/1411/c#net_investment_income
entity: TaxUnit
from 2013-01-01: niit_rate * min(net_investment_income, excess_magi)Format comparison
RAC is purpose-built for encoding law with auditability and temporal accuracy.
| Capability | DMN | OpenFisca/PE | Catala | RAC |
|---|---|---|---|---|
| Legal citations | Partial | Partial | ||
| Temporal versioning | ||||
| Formula language | FEEL | Python | Custom | Python-like |
| File format | XML | Py + YAML | Custom | Custom DSL |
| Self-contained | ||||
| Reform modeling | ||||
| No magic numbers | ||||
| LLM-friendly | Partial | Partial |
Legal citations
Filepath mirrors statute citation. 26/24/d/1/B.rac encodes 26 USC § 24(d)(1)(B).
Time-varying values
Policy values change over time. Definitions track every historical value with from effective dates.
No magic numbers
Only small integers (-1 to 3) allowed in formulas. All policy values must come from named definitions with statute citations.
Cross-references
Statute sections reference each other by name. The compiler resolves dependencies via topological sort.
Reform modeling
The amend keyword overrides any definition with new values. Model policy reforms without touching enacted statute files.
Temporal formulas
When laws change, track different formula versions with from effective dates and sunset provisions.
AutoRAC
Point it at a statute. Get validated RAC.
3-tier validation pipeline
CI validation
rac pytest — instant, free
Catches syntax errors, format issues, missing imports
External oracles
Fast (~10s), free — generates comparison data for LLM reviewers
LLM reviewers
Receive oracle comparison data to diagnose WHY discrepancies exist
RAC_SPEC.md
Complete specification for the .rac file format
# RAC file specification
Self-contained statute encoding format for tax and benefit rules.
Parsed by a recursive descent parser into a typed AST.
## File Structure
```
# path/to/section.rac - Title
# Statute text in comments
# (a) In general.— ...
from 2024-01-01: 100
from 2023-01-01: 95
entity: TaxUnit
from 2024-01-01: param_name * input_value
```
## Top-level declarations
| Declaration | Syntax | Purpose |
|-------------|--------|---------|
| Comment | `# ...` | Statute text, section headers |
| Definition | `name:` | Parameter or computed value (inferred from fields) |
| `entity` | `entity name:` | Entity type with fields |
| `amend` | `amend path:` | Override for reform modeling |
## Entity declarations
Define entity types with typed fields and relationships:
```
entity Person:
age: int
income: float
tax_unit: -> TaxUnit
entity TaxUnit:
members: [Person]
```
## Definitions (parameters and computed values)
No keyword prefix needed — the parser infers type from fields.
Definitions without `entity:` are parameters (pure scalar values).
Definitions with `entity:` are computed per-entity.
Optional metadata fields: `source`, `label`, `description`, `unit`.
```
# Parameter: "30 per centum of household income"
from 1977-10-01: 0.30
# Computed value
entity: Household
from 1977-10-01:
max(0, thrifty_food_plan_cost -
snap_net_income * income_contribution_rate)
```
Definitions earlier in a file are in scope for later ones.
## Temporal values
Use `from YYYY-MM-DD:` for effective dates.
Use `from DATE to DATE:` for sunset provisions:
```
from 1998-01-01: 400
from 1999-01-01: 500
from 2001-01-01: 600
from 2003-01-01: 1000
from 2018-01-01: 2000 # TCJA
from 2025-01-01: 2200 # P.L. 119-21
# Sunset clause
from 2021-01-01 to 2025-12-31: 1600
```
## Expression syntax
Python-like with restrictions:
- Conditionals: `if cond: expr else: expr`
- Pattern matching: `match expr: pattern => result`
- Logic: `and`, `or`, `not`
- Built-ins: `max`, `min`, `abs`, `round`, `sum`, `len`, `clip`
- Field access: `person.income`
- **No magic numbers** — only -1, 0, 1, 2, 3 in formulas
```
entity: TaxUnit
from 2026-01-01:
if is_joint_return: joint_rate else: single_rate
entity: TaxUnit
from 2026-01-01:
match filing_status:
"SINGLE" => single_threshold
"JOINT" => joint_threshold
```
## Amendments (Reform Modeling)
```
amend gov/tax/personal_allowance:
from 2025-04-06: 15000
```
## File Naming
Filepath = legal citation:
```
statute/7/2017/a.rac -> 7 USC 2017(a)
statute/26/24/d/1/B.rac -> 26 USC 24(d)(1)(B)
statute/26/32/b.rac -> 26 USC 32(b)
```Verifiable rewards
AI systems answering questions about policy rules need ground truth. RAC encodings provide verifiable correctness signals for training.
Training datasets
Millions of (situation, correct_answer) pairs grounded in actual statute. Not synthetic - legally verified.
Verifier
LLM generates answer, RAC executor checks correctness, binary reward signal. Real-time RLVR for policy rule accuracy.
Evaluation benchmarks
Standardized test suites measuring AI accuracy on EITC, SNAP, Medicaid, and hundreds more programs.
Encoding coverage
Current state of statute encoding across jurisdictions.
Federal (rac-us)
74 .rac files • EITC • CTC • ACA PTC • standard deduction • SNAP • education credits
California (rac-us-ca)
23 .rac files • RTC §17041 income tax • CalEITC • Young Child Tax Credit • Mental Health surtax
New York (rac-us-ny)
7 .rac files • Tax Law §601 rates • NY EITC • Empire State Child Credit • NYC income tax
Experiment lab
Live experiment tracking, agent transcripts, and calibration data. See what AutoRAC is working on in real time.
Encoding runs
Track every statute encoding attempt. See iteration counts, oracle match rates, and reviewer verdicts.
Agent transcripts
Full chronological view of agent thinking, tool calls, and outputs. See orchestrator reasoning for why each agent was spawned.
SDK sessions
Mission-level view of encoding campaigns. Token usage, cost tracking, and event streams from the Agent SDK.
Get involved
Rule Atlas builds open infrastructure for encoded law.