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.

Platform

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

Provenance tracking — fetch date, source URL, checksums
Full-text search — query by citation, keyword, or path
Change detection — know when upstream sources update
What is RAC

Rules as Code

A domain-specific language for encoding rules with auditability, temporal versioning, and legal citations built in.

26 USC § 1411(a)
(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.
AutoRAC
statute/26/1411/a.rac
niit_rate:
    from 2013-01-01: 0.038

net_investment_income_tax:
    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.

File format

.rac

Self-contained statute encoding format. One file captures the law: statute text, parameters, and computed values.

statute/26/1411/a.racSingle self-contained file
# 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"
niit_rate:
    from 2013-01-01: 0.038

# Lesser of NII or excess MAGI over threshold
excess_magi:
    imports:
        - 26/62#modified_agi
        - 26/1411/b#threshold_amount
    entity: TaxUnit
    from 2013-01-01: max(0, modified_agi - threshold_amount)

net_investment_income_tax:
    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.

CapabilityDMNOpenFisca/PECatalaRAC
Legal citationsPartialPartial
Temporal versioning
Formula languageFEELPythonCustomPython-like
File formatXMLPy + YAMLCustomCustom DSL
Self-contained
Reform modeling
No magic numbers
LLM-friendlyPartialPartial

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.

AI encoding

AutoRAC

Point it at a statute. Get validated RAC.

autorac — zsh
$ autorac encode "26 USC 32"
 
[atlas] Loading 26 USC 32... 81,247 characters
[atlas] Parsing subsection tree...
[atlas] (a) Allowance of credit 2,341 chars
[atlas] (b) Percentages and amounts 4,892 chars
[atlas] (c) Definitions and special rules 5,675 chars
[atlas] ...
[atlas] (n) Supplemental child credit 1,203 chars
[atlas] 14 subsections extracted
 
[encode] Wave 1: (a), (b), (c), (d), (f), (h), (i), (j), (m), (n)
[encode] Wave 2: (e), (g), (k), (l) — depends on wave 1
[encode] ████████████████████ 14/14 complete
 
[validate] CI: 14/14 passed
[validate] PolicyEngine: 12/14 match
[validate] TAXSIM: 11/14 match
[validate] LLM review: 2 issues flagged → auto-fixing
 
[done] 14 .rac files written to statute/26/32/

3-tier validation pipeline

1

CI validation

rac pytest — instant, free

Catches syntax errors, format issues, missing imports

Fail - Fix errors, retry (max 3) Pass - Proceed to oracles
2

External oracles

PEPolicyEngineTXTAXSIM

Fast (~10s), free — generates comparison data for LLM reviewers

3

LLM reviewers

RAC ReviewerFormula ReviewerParameter ReviewerIntegration Reviewer

Receive oracle comparison data to diagnose WHY discrepancies exist

14 subsections → 14 parallel agents → 14 .rac files
Each agent sees only its subsection — no wasted context
Validated against real-world calculators, not just syntax
Every encoding decision logged for audit
Reference

RAC_SPEC.md

Complete specification for the .rac file format

RAC_SPEC.md
# 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.— ...

param_name:
    from 2024-01-01: 100
    from 2023-01-01: 95

var_name:
    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"
income_contribution_rate:
    from 1977-10-01: 0.30

# Computed value
snap_allotment:
    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:

```
ctc_base_amount:
    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
arpa_bonus:
    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

```
applicable_percentage:
    entity: TaxUnit
    from 2026-01-01:
        if is_joint_return: joint_rate else: single_rate

threshold:
    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)
```
Ground truth for AI

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.

Progress

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

100+ total .rac files across 3 US jurisdictions
Canada benefits also encoded (.cosilico format)
All encodings validated against external oracles