Back to all work
IRALOGIX, Inc.

Evidence-Gated Agent Workspace for Compliance Rules

Each US state sets its own retirement mandate for employers. This system turns those laws into rules a program can run, and legal specialists write them together with an AI agent.

Team lead, five-person CMU Studio team2026Rules generated for 20 statesDeployed for IRALOGIX internal users

How a rule gets written

Example data
Legal specialist
chat
Agenttool looproutes each requestno write path
read-only tools
plan modeConfirm

API serverthe tools behind the agent

  • read rules
  • read sources
  • read version history
  • read state resources

Generation pipelinethe only write path

  1. research
  2. build candidate
  3. engine test
  4. ↺ repair
returns
  • candidate
  • no change
  • needs input
  • failed

Rule Studio chat1 · Questionread-only answer2 · Change requestplan, confirm, diff

How does Illinois count employees for the mandate?

Agent used read rulesread sources

The rule uses the lowest quarterly count in the previous calendar year. The threshold is 5 employees.Answered from reads. Nothing queued, nothing changed.

Make the employee-count question clearer.

Agent · proposed plan

Keep the threshold at 5. Clarify the question wording. Prepare a candidate for review.

Confirm plan

Candidate · wording changeengine test · pass

Minimum quarterly Illinois employee count during the previous calendar year?
What was your lowest quarterly count of Illinois employees in the previous calendar year?
Staged for side-by-side review. Applying it is a separate step.

7 / 7Reads go straight to tools. A write needs a confirmed plan and comes back as a tested candidate.

  1. A legal specialist asks the agent a question.
  2. The agent loops over read-only tools until it can answer. Nothing is written.
  3. Next, the specialist asks for a change.
  4. A change is routed to plan mode. The agent proposes a plan, not an edit.
  5. A person confirms the plan. That is the only way into the write path.
  6. The pipeline builds a candidate, tests it on the real engine, and returns one of four named outcomes.
  7. Reads go straight to tools. A write needs a confirmed plan and comes back as a tested candidate.

The agent can read everything and write nothing. Only a person can confirm a plan, apply a draft, or approve a version.

Think of pull requests for law. The agent opens the change, an engine runs it like CI, a legal specialist reviews, and the merge is blocked when the cited source no longer matches.

How a version goes live

Example data

Check every cited source, read again at approval

v4Waiting for approval
v3Live now
Illinois · sources cited by v4capturedthenread againnow

Web pages are compared by main text. PDFs byte for byte.

Retirement statuteHTMLa41f····a41f
Program rulesHTMLb72c····b72c
Program pageHTMLc98d····c98d
Employer guidePDFd10e····e71b

Approval blocked. No override.Regenerate from the current sources.

3 / 3One source changed, so approval is blocked. Nobody can override it, and the live version stays live.

  1. A legal specialist asks to approve v4. v3 is live.
  2. Every cited source is read again and compared with its snapshot.
  3. One source changed, so approval is blocked. Nobody can override it, and the live version stays live.

At approval the system fetches every cited source again. One changed source blocks approval, and nobody can override it.

More on how rules are checked

Workspace boundary

Its read-only tools access the rule bundle, selected source inventory, state resources, and version histories.

The chat agent's job is judgment over messy sources, so it gets broad read access and no write path. Only a person can confirm a plan, apply a candidate, or approve a version. A confirmed plan freezes one generation request in the API queue. A cancelled or failed run leaves the draft unchanged.

Workspace boundary: problem, implementation, reasoning, and outcome
Problem
Legal specialists need help researching and drafting state rule changes, but an agent that can write rules could silently change what employer assessments depend on. Long research conversations also have to survive worker restarts.
Implementation
Legal specialists chat with a resident worker that hosts the agent on Amazon Bedrock. Its read-only tools access the rule bundle, selected source inventory, state resources, and version histories. The selected source inventory is fixed, but reading a source fetches its live content. Chat session checkpoints are stored on the workspace and validated for configuration, size, integrity, and session identity before restore. A confirmed plan freezes one generation request in the API queue. The API dispatches it when capacity is available. The worker claims the run atomically, reports activity and model usage, and returns one of four named outcomes: candidate, no change, needs input, or failed. Applying it is a separate action. A teammate built research generation and quote validation.
Reasoning
The chat agent's job is judgment over messy sources, so it gets broad read access and no write path. Freezing each request and naming every outcome makes runs auditable, and lets the workspace treat "nothing to change" or "ask the reviewer" as normal results instead of errors.
Outcome
As of November 2026, rules for 20 states have been generated and are moving through specialist approval. IRALOGIX internal users have worked with the system through several rounds of feedback.

Candidate validation

Candidate checks run representative answers through the real engine and send failures back to the agent for repair.

Schema validation alone cannot show whether a generated questionnaire can run. Exercising the real engine exposes failures before a legal specialist reviews the draft. Findings trigger a repair turn in the same agent session, with one extra candidate attempt by default. A repeated finding signature or an exhausted budget ends the run without a draft.

Candidate validation: problem, implementation, reasoning, and outcome
Problem
Legal specialists need help researching and drafting state rule changes, but an agent that can write rules could silently change what employer assessments depend on. Long research conversations also have to survive worker restarts.
Implementation
Candidate validation resolves the rule graph and exercises representative answers through the real engine, checking for engine errors, dead ends, unanswerable questions, and invalid outcomes. Crashed checks fail closed. Findings trigger a repair turn in the same agent session, with one extra candidate attempt by default. A repeated finding signature or an exhausted budget ends the run without a draft. The API stages a passing candidate for side-by-side comparison.
Reasoning
Schema validation alone cannot show whether a generated questionnaire can run. Exercising the real engine exposes failures before a legal specialist reviews the draft.
Outcome
As of November 2026, rules for 20 states have been generated and are moving through specialist approval. IRALOGIX internal users have worked with the system through several rounds of feedback.

Evidence gate

Source drift blocks approval and requires regeneration.

At approval, the worker re-fetches live sources using the recorded capture profile. It compares a hash of normalized main text for HTML and raw bytes for PDFs. SOURCE_CHANGED has no override. The legal specialist must regenerate from current sources, review and apply the new candidate, then request approval again.

Evidence gate: problem, implementation, reasoning, and outcome
Problem
Generated output cannot become compliance authority, and neither can a live web page. State sites change or disappear, so a rule approved against a URL is hard to defend later. Reviewers also need to trace a rule across values, questionnaire logic, wording, and the source it came from. A cited source can change between generation and approval.
Implementation
Each state is modeled as four versioned artifacts linked by stable identifiers: a rule model, decision graph, wording catalog, and audit trail. Cited sources are captured HTTP-first with a serialized Playwright fallback for pages that need a browser, with SHA-256 fingerprints. The review workbench presents model and source together, lets legal specialists test a pending version through the session runner, and records the reviewer name supplied with a decision. At approval, the worker re-fetches live sources using the recorded capture profile. It compares a hash of normalized main text for HTML and raw bytes for PDFs. Only after all cited sources match are verified captures saved in S3. SOURCE_CHANGED has no override. Drift marks the evidence stale, leaves the new bundle pending, and preserves the prior active bundle. The legal specialist must regenerate from current sources, review and apply the new candidate, then request approval again.
Reasoning
The schema constrains what an author or agent can propose, and the review gate determines what is authoritative. Snapshots preserve the source text used by a rule, while re-fetching live sources stops a stale draft from becoming active. Approval checks live evidence rather than re-reading an archive. Browsers are the worker's largest memory cost, so a file lock allows one Chromium at a time in that pod. HTTP-first capture keeps that heavy dependency off the common path. The gate checks evidence freshness and does not guarantee legal correctness.
Outcome
As of November 2026, rules for 20 states have been generated and are moving through specialist approval. IRALOGIX internal users have worked with the system through several rounds of feedback.

What a rule does once it is live

Example data, simplified from the Illinois rule bundle

Employers

Employer A

active
  • 3 employees, since 2020
  • No qualified plan
  • Required steps: done

Employer B

active
  • 3 employees, since 2020
  • No qualified plan

Employer C

active
  • 12 employees
  • 401(k) plan

Illinois question path

1401(k)2no plan23<54≥545Entity type?For-profitQualified plan?401(k) or noneBusiness start date?At least 2 yearsIllinois headcount?≥5, prior-year min quarterRequired steps done?All three stepsExemptNo action requiredNot requiredThreshold not metCoveredby the mandate1401(k)2no plan23<54≥545Entity type?For-profitQualified plan?401(k) or noneBusiness start date?At least 2 yearsIllinois headcount?≥5, prior-year min quarterRequired steps done?All three stepsExemptNo actionNot requiredBelow thresholdCoveredby the mandate

Results

Employer A

Not requiredSame log, same result

Employer B

Not requiredBelow 5-employee threshold

Employer C

ExemptQualified 401(k) plan
Rule version r202606, pinnedWording en-US, pinned
Employer A · append-only logreplay computes the current result
01 entity02 plan03 start04 headcount05 register06 employees07 deductions08 rewind headcount09 headcount
  1. Employer A follows the rules to Covered by the mandate.
  2. Employer B's three employees lead to Not required.
  3. Employer C's 401(k) plan leads to Exempt.
  4. A rewinds headcount. The old answers remain logged.
  5. A answers 3. Replaying the log returns Not required.
  6. Replaying the same log returns the same result. Version pins stay fixed.
6 / 6Replaying the same log returns the same result. Version pins stay fixed.

The engine asks one question at a time and follows the approved rules to a result. No AI runs at this stage.

  • Deterministic.The same answers and the same rule version give the same result.
  • Pinned.A session keeps the rule version it started with.
  • Nothing is erased.Every answer is kept, so a session can resume, rewind, or branch.
More on the engine

I designed and implemented a deterministic Python/FastAPI engine with RESTful APIs over pinned rule bundles. Append-only session histories make employer assessments reproducible and let sessions resume or branch.

A pure projector folds the pinned bundle and event log into the current frontier, gates, outcome, and report state.

  • Deterministic. The same log and bundle always give the same result. No I/O or model call happens during a turn.
  • Pinned. A session keeps the rule version and wording it started with, even after a newer version goes live.
  • Rewind keeps a true path. A rewind drops the answer it names and every later answer from the effective path.
  • Derived status. Status is always computed from the log.
Problem, implementation, reasoning, and outcome
Problem
An employer may return later or test another answer. The result must remain reproducible after rules or wording change, and the same answers must always produce the same guidance.
Implementation
A pure projector folds the pinned bundle and event log into the current frontier, gates, outcome, and report state. The session row pins rule and catalog versions plus locale. The append-only log records answers and rewinds. A fork copies a selected event prefix into a new session with the same pins. No live model call or external fetch sits on the assessment path.
Reasoning
Agent work belongs before approval, where a person reviews it. Mutable questionnaire rows would erase how a result was reached, so append-only history makes replay and branching explicit, and version pins keep the same log from changing meaning later.
Outcome
Resume, rewind, and session fork are implemented. The alert subsystem projects saved session histories and dispatches notifications through the signed webhook channel.

My role

I led product direction and architecture for the whole system, as team lead of a five-person CMU Studio team.

I built the agent workspace API, read-only chat tools, dispatch, candidate validation, staging, the approval-time evidence gate, and the deterministic Python/FastAPI engine. I designed the generation pipeline. A teammate built its research generation and quote validation.

Tech stackPython, FastAPI, Amazon Bedrock, MCP, PostgreSQL, Amazon S3, Playwright, Event sourcing, OAuth2/OIDC, Kubernetes

System map

System map

Logixian runtime view Legal specialists reach the API server through the Portal and IRALOGIX calls it directly, both with OAuth client tokens from an external identity provider whose signing keys the API verifies. The API server owns PostgreSQL and delivers webhooks back to IRALOGIX. It hands chat turns, generation runs and approval captures to three workers that have no database access. The workers call Amazon Bedrock and read regulation sources, and source capture uploads saved copies to the evidence store. IRALOGIX External services Logixian Workers, no databaseaccess Legal specialist IRALOGIX team IRALOGIX platform Employer sessions and alerts Identity provider OAuth client tokens for IRALOGIX and the Portal Portal Review UI API server Compliance engine Rule Studio backend Generation queue Approvals Alerts, webhooks PostgreSQL System of record Rule Studio chat Answers the specialist Generation pipeline Drafts candidate bundles Source capture Verifies sources at approval Evidence store Saved source copies Amazon Bedrock Claude models Regulation sources State government sites uses calls runs sessions sends alerts get token get signing keys reads, writes chat turn generate approve upload inference read request async delivery component data store outside Logixian
IRALOGIX
Legal specialistIRALOGIX team
uses
PortalReview UI
IRALOGIX platformEmployer sessions and alerts
get token
Identity providerOAuth client tokens for IRALOGIX and the Portal
Logixian
calls · runs sessions · sends alerts
API serverCompliance engine, Rule Studio backend, Generation queue, Approvals, Alerts, webhooks
reads, writes
PostgreSQLSystem of record

get signing keys

Workers, no database access
chat turn
Rule Studio chatAnswers the specialist
generate
Generation pipelineDrafts candidate bundles
approve
Source captureVerifies sources at approval
upload
Evidence storeSaved source copies
External services
inference
Amazon BedrockClaude models
read
Regulation sourcesState government sites

request · async delivery · component · data store · outside Logixian

Blue outlines mark my Portal, workspace/API, chat-tool, and source-capture work. The API also contains team contributions.

Questions

What stops the AI from publishing a wrong rule?

The agent has no write path. It can read the rules and sources, and it can propose a candidate. Each candidate runs representative answers through the real engine, and failures go back to the agent for repair. A passing candidate is only staged for side-by-side comparison.

A legal specialist applies it, and approval is a separate step that checks the cited sources again. The gate checks that the evidence is current. It does not guarantee legal correctness.

Source evidence and approval

Approval sequence A reviewer approves revision N in the Portal. The API freezes the revision and its fingerprints and launches a source capture Job. The Job fetches the frozen request, re-reads every cited source with its pinned profile, and compares every hash before saving anything. If all match it uploads the packages to the evidence store and reports the captures. The API re-checks them, activates the version and supersedes the previous one in a single transaction. Reviewer API server Source capture Job Regulation sources Evidence store 1approve revision N 2freeze revision and fingerprints 3launch Job 4fetch the frozen request 5re-read every cited URL 6compare every hash before saving any 7all match: upload packages, write-once 8report captures 9re-check, activate, supersede the old version 10revision N is active
1 · approve revision NReviewer → API server
2 · freeze revision and fingerprintsAPI server
3 · launch JobAPI server → Source capture Job
4 · fetch the frozen requestSource capture Job → API server
5 · re-read every cited URLSource capture Job → Regulation sources
6 · compare every hash before saving anySource capture Job
7 · all match: upload packages, write-onceSource capture Job → Evidence store
8 · report capturesSource capture Job → API server
9 · re-check, activate, supersede the old versionAPI server
10 · revision N is activeAPI server → Reviewer
I built the source-drift gate and source-capture path. Blue outlines mark the API, capture Job, and evidence comparison. The API freezes a revision, the Job checks all cited live sources before saving any, and activation re-checks the frozen identity and evidence. HTML comparison uses normalized main text. PDFs use original bytes. Reviewer names are recorded without individual API authentication.
ResultMeaningNext step
ActivatedEvery source matched and its evidence is stored.New sessions may use the active version.
SOURCE_CHANGEDCited source text changed.Regenerate from current sources.
SOURCE_UNREADABLEA source is gone, outside the allow list, or missing its main content.Fix or replace the source, then regenerate.
Temporary failureCapture failed, upload failed, or the attempt timed out.Retry approval.
What happens when a source changes after a rule is drafted?

At approval, the worker fetches each cited source again and compares it with the snapshot used during generation. If any source changed, approval is blocked and there is no override. The new version stays pending, the version already live stays live, and the specialist regenerates from the current sources.

Bundle lifecycle

Rule bundle lifecycle A workspace starts with a draft. Confirming a plan queues a generation run. A successful run produces a candidate, which a reviewer applies as a new draft revision. A cancelled, failed or empty run leaves the draft unchanged. Approving the draft starts a source capture. If every source matches, the version becomes active and the previous active version is superseded. If capture fails, the draft stays as it was and the reviewer retries or regenerates. Generation run Draft head revision Queued waits in PostgreSQL Generating pipeline running Candidate awaiting review Approving sources re-read Active serves new sessions Superseded kept for audit confirm plan dispatch succeeds apply: new revision cancel, fail or no change approve all match next approved fails: retry or regenerate
Drafthead revision
Generation run
confirm plan
Queuedwaits in PostgreSQL
dispatch
Generatingpipeline running
succeeds
Candidateawaiting review
apply: new revision
Drafthead revision

cancel, fail or no change → Draft

approve
Approvingsources re-read
all match
Activeserves new sessions
next approved
Supersededkept for audit

fails: retry or regenerate → Draft

Confirm queues a plan, successful generation returns a candidate, and a legal specialist applies it as a new draft revision. Approval is a separate step. Failure leaves the draft unchanged.
Why are employer assessments deterministic?

AI helps write and repair the rules in the workspace. Once a rule is approved, the engine that runs an employer's assessment makes no model call and no external fetch. The same answers and the same rule version always give the same result, and a session keeps the version it started with.

Agent work belongs before approval, where a person reviews it.

Deterministic engine modules

Compliance engine module view Callers reach the sessions routes in the API server. The session service pins versions, loads the pinned bundle through the bundle store, validates the new answer and projects the session with the pure engine library, then appends the event through the session store. Both stores read and write PostgreSQL. API server Engine library, pure, no I/O Callers IRALOGIX platform, simulator Sessions routes start, append, read, scopes sessions/router.py Session service Pins rule and wording versions Validates, projects, then saves Refuses a moved revision Bundle store pinned bundle and wording rules/bundle_store.py Session store append-only event log sessions/store.py Projector engine/projector.py Folds the events, evaluates gates with three-valued logic, picks the next question or the final status Answer validation engine/facade.py Checks type and options before an answer is accepted PostgreSQL sessions, session_events, rule_bundles, catalogs project validate load append uses pure function, no I/O module data store Paths are relative to api-server/api_server/ and logixian-lib/logixian_lib/
CallersIRALOGIX platform, simulator
API server
Sessions routesstart, append, read, scopes · sessions/router.py
Session servicePins rule and wording versions · Validates, projects, then saves · Refuses a moved revision
load
Bundle storepinned bundle and wording · rules/bundle_store.py
append
Session storeappend-only event log · sessions/store.py
Engine library, pure, no I/O
project
ProjectorFolds the events, evaluates gates with three-valued logic, picks the next question or the final status · engine/projector.py
validate
Answer validationChecks type and options before an answer is accepted · engine/facade.py
PostgreSQLsessions, session_events, rule_bundles, catalogs

uses · pure function, no I/O · module · data store · Paths are relative to api-server/api_server/ and logixian-lib/logixian_lib/

I implemented the deterministic engine and session API path. Blue outlines mark those modules. The pure projector performs no I/O or model calls. Sessions preserve rule and wording pins. Resume projects the saved log, rewind changes effective answers, and fork copies a selected event prefix into a new session with the same pins.
How does the workspace run a generation?

A legal specialist chats with an agent hosted on Amazon Bedrock. Confirming a plan freezes one generation request in the API queue. A worker claims it and returns one of four named outcomes: candidate, no change, needs input, or failed. Naming every outcome makes each run auditable, and lets the workspace treat "nothing to change" as a normal result.

Agent workspace and worker boundary

Rule Studio components The Portal's Rule Studio screens call the API server. Inside the API, workspaces and chat dispatch chat turns to the chat agent, the generation queue dispatches runs to the generation pipeline, and approvals launch a source capture Job. Workers call back through the API's internal routes. A successful approval activates a version in the rule registry. The Job uploads saved copies to the evidence store. The workers call Amazon Bedrock and read regulation sources. API server Agent worker, one pod Portal Rule Studio screens Workspaces and chat Revisions, messages, candidates Generation queue Dispatches the oldest confirmed run Approvals Freezes a revision, checks captures Rule registry Pending, active, superseded versions PostgreSQL stores all four Chat agent Read-only tools Generation pipeline Phases, validators, repair Source capture Job Re-reads, compares, saves Evidence store S3, CloudFront Amazon Bedrock Claude models Regulation sources calls turn run launch activate reads, writes upload re-read request dispatch, then callbacks through the API's internal routes job data store outside the component
PortalRule Studio screens
API server
calls
Workspaces and chatRevisions, messages, candidates
Generation queueDispatches the oldest confirmed run
ApprovalsFreezes a revision, checks captures
activate
Rule registryPending, active, superseded versions
reads, writes
PostgreSQLstores all four
Agent worker, one pod
turn
Chat agentRead-only tools
run
Generation pipelinePhases, validators, repair
launch
Source capture JobRe-reads, compares, saves
upload
Evidence storeS3, CloudFront
Amazon BedrockClaude models
re-read
Regulation sources

request · dispatch, then callbacks through the API's internal routes · job · data store · outside the component

Blue outlines mark my workspace API, chat tools, dispatch queue, staging and approval boundaries. A teammate built research generation and quote validation.
What happens inside a generation run?

A run moves through statute research, enrichment, audit, and quote checks, then builds a candidate. The candidate runs through the real engine, and any finding goes back to the same agent for repair. Repeated failures or an exhausted repair budget end the run without a draft to review.

Generation pipeline

Generation pipeline A frozen request flows through three agent phases, statute, enrichment and audit, and three deterministic steps, an enrichment check, a final validation and a build, to produce a candidate bundle. The two checks send failures back to the agent for up to three repairs each, then fail the run. The statute and enrichment phases read sources only through fetch tools that enforce the allow list and fingerprint every read. The audit phase works from those captures and fetches nothing new. Request state, sources, prompt, base Statute drafts rules from statutes Enrichment adds program and other sources Check schema, statute values kept Audit quotes a source for every rule Validate structure, coverage, every quote Build rule graph and en-US catalog Candidate model, graph, catalog, audit repair, up to 3, then fail repair, up to 3, then fail Fetch tools Allow-listed URLs only, HTTP first, browser fallback, every read fingerprinted Regulation sources reads earlier captures, fetches nothing new agent phase, Claude on Bedrock deterministic step data repair loop
Requeststate, sources, prompt, base
Statutedrafts rules from statutes
Enrichmentadds program and other sources
Checkschema, statute values kept

Check → Enrichment: repair, up to 3, then fail

Auditquotes a source for every rule · reads earlier captures, fetches nothing new
Validatestructure, coverage, every quote
Buildrule graph and en-US catalog
Candidatemodel, graph, catalog, audit

Validate → Audit: repair, up to 3, then fail

Fetch toolsAllow-listed URLs only, HTTP first, browser fallback, every read fingerprinted
Regulation sources

agent phase, Claude on Bedrock · deterministic step · data · repair loop

The phases, validators, and repair loop of one run.
How do other systems call it?

Everything goes through one API: the review Portal, agents over MCP, IRALOGIX systems, and internal jobs. The API verifies each caller's token, then looks up what that client may do in a local registry. A client can be limited or turned off without waiting for a token to expire. Outbound webhooks are signed.

Two trust paths, one authorization model

Authenticated integration boundaryThe review portal and IRALOGIX systems present OAuth tokens. Internal workers present separately issued Ed25519 tokens. The same middleware verifies the issuer and identifies the client, then a local registry decides whether that client is enabled and which scopes it holds before the request reaches the API.CallersCredentialVerifyAuthorizeRoutePortal UI + MCPone scoped M2M clientIRALOGIX systemsexternal clientsInternal workersscheduled write-backOAuth2 / OIDC JWTexternal issuerEd25519 JWTinternal issuerAuth middlewareverify signature + issueridentify the clientClient registryenabledgranted scopesScoped APIexternalinternalAuthentication proves the caller.Registry data grants or revokes power.
Callers → Credential
Portal UI + MCPone scoped M2M client → OAuth2 / OIDC JWT
IRALOGIX systemsexternal clients → OAuth2 / OIDC JWT
Internal workersscheduled write-back → Ed25519 JWT
OAuth2 / OIDC JWTexternal issuer
Ed25519 JWTinternal issuer
Verify → Authorize → Route
Auth middlewareverify signature + issuer · identify the client
Client registryenabled · granted scopes
Scoped APIexternal · internal

Authentication proves the caller. Registry data grants or revokes power.

The portal is deliberately an ordinary client rather than a privileged side channel. If a workflow cannot be completed through the scoped API, the integration contract is incomplete.