PolicyStrata: Responsibility-Scoped Testing for Cross-Layer Policy Drift in LLM Data Agents
PolicyStrata detects cross-layer policy drift in LLM data agents with responsibility-scoped tests, clean controls, and minimized failure witnesses.
See PolicyStratain the Raintree portfolio →- Non-clean cases
- 1,720 / 1,720 detected
- Clean controls
- 80 tested, 0 false positives
Abstract
LLM data agents translate natural-language requests into semantic plans, SQL queries, and analytical answers. Existing evaluations emphasize text-to-SQL correctness, malformed-output reduction, or model refusal behavior. Deployed agents also replicate authorization, semantic, lineage, version, and release obligations across model-visible manifests, grammars, validators, compilers, database controls, and output filters. These non-equivalent surfaces can drift after policy, schema, or semantic model updates, producing failures that component tests miss.
We present PolicyStrata, a regression-testing framework for cross-layer policy drift in governed data-agent stacks. PolicyStrata generates principals, requests, plans, mixed-version surface configurations, database states, and lowered queries, then checks whether each surface preserves its assigned authorization, semantic, lineage, containment, and release obligations. Its minimized witnesses identify the first violated transition. The artifact includes DataPolicyDriftBench, a deterministic benchmark with three analytics domains; seeded, generated, detector-frozen held-out, and clean-control suites; baseline comparators; ablations; JSONL traces; optional database smoke fixtures; and a brownfield integration check. On deterministic, non-equivalent mutant suites generated from the implemented operators and fixtures, PolicyStrata reports witnesses for all 1720 covered injected faults, with 0 false positives on 80 clean controls. This is v1 fault-model coverage, not recall on unknown production faults.
Each layer has a different responsibility.
A grammar, validator, compiler, database policy, and release filter are not equivalent representations. PolicyStrata checks whether each one preserves the obligation assigned to it as a request moves from model-visible input to released output.
- Layer 1
Manifest or grammar
Expose only capabilities whose reachable operations are authorized for the principal and runtime context.
- Layer 2
Semantic-plan validator
Accept supported authorized plans and reject unauthorized plans inside the declared support envelope.
- Layer 3
Compiler or lowering
Preserve tenant, purpose, policy version, lineage, and business semantics while producing executable work.
- Layer 4
Database policy and RLS
Contain unauthorized executable operations under the database role that runs the query.
- Layer 5
Release policy
Release only result-lineage pairs allowed to cross the human, model, log, cache, or tool boundary.
Generate, replay, localize, and minimize.
- 1
Sample or import a principal, request, database state, and version vector for every policy-bearing surface.
- 2
Derive authorization, semantic, lineage, and release expectations from independently implemented reference interpreters.
- 3
Replay manifest exposure, validation, compiler lowering, database containment, and the release decision.
- 4
Check each transition against that surface's responsibility and stop at the first violated obligation.
- 5
Minimize the principal, request, plan, policy clauses, database rows, version vector, and SQL while preserving the failure.
- 6
Emit deterministic JSONL traces, a minimized witness, provenance hashes, suite summaries, baselines, and ablations.
Deterministic coverage, controls, baselines, and ablations.
The benchmark spans support SaaS, household finance, and product analytics fixtures. These results measure the implemented fault model. They do not claim recall on unknown production failures.
| Suite | Cases | Faults detected | Controls / false positives |
|---|---|---|---|
| Support seeded | 50 | 50 / 50 | — |
| Support generated | 500 | 500 / 500 | — |
| Support heldout-v1 | 500 | 500 / 500 | — |
| Finance seeded | 20 | 20 / 20 | — |
| Finance heldout-v1 | 250 | 250 / 250 | — |
| Analytics seeded | 100 | 100 / 100 | — |
| Analytics generated | 300 | 300 / 300 | — |
| Clean controls | 80 | — | 80 / 0 |
| Total | 1,800 | 1,720 / 1,720 | 80 / 0 |
Baseline comparison
| Comparator | Detected |
|---|---|
| Grammar only | 121 / 1,720 |
| Semantic validator only | 573 / 1,720 |
| SQL AST policy checker | 1,043 / 1,720 |
| Database policy only | 326 / 1,720 |
| Release filter only | 364 / 1,720 |
| Lineage only | 239 / 1,720 |
| Random data generation | 1,246 / 1,720 |
| Naive surface equality | 573 / 1,720 |
| Defense-in-depth stack | 1,561 / 1,720 |
| PolicyStrata | 1,720 / 1,720 |
Ablation results
| Ablation | Detected | Missed |
|---|---|---|
| Without database containment | 1,394 | 326 |
| Without independent oracle | 1,357 | 363 |
| Without lineage | 1,657 | 63 |
| Without release policy | 1,682 | 38 |
| Without transition obligations | 363 | 1,357 |
PolicyStrata emitted witnesses for all 1,720 injected faults covered by the deterministic v1 operators and fixtures, with no false positives across 80 clean controls.
The defense-in-depth point-check baseline detected 1,561 of 1,720 cases. Its 159 misses lacked responsibility-scoped transition contracts or witness attribution.
Removing transition obligations caused the largest ablation loss: 1,357 of 1,720 non-clean cases were missed.
The artifact generated 1,800 deterministic traces and 1,720 minimized JSON witnesses without an LLM API key or host PostgreSQL installation.
What the result does not establish.
The 1,720/1,720 result measures coverage of implemented deterministic fault operators and fixtures, not recall on unknown production faults.
Detector-frozen held-out suites reduce post-hoc tuning risk but remain built-in synthetic cases rather than independently authored or blinded benchmarks.
Independent reference interpreters cannot detect a uniformly wrong canonical policy without an external specification or human-reviewed oracle.
Surface adapters belong to the trusted computing base and can hide or invent drift if their mappings are wrong.
Generated database states can miss semantic differences outside the searched state space; equal visible results do not prove authorized lineage.
Write actions, adaptive privacy, sequential or history-aware release, and model-in-the-loop exploitability are outside the deterministic v1 guarantee.
Cite the paper and inspect the related work.
BibTeX
@article{roth2026policystrata,
title = {PolicyStrata: Responsibility-Scoped Testing for Cross-Layer Policy Drift in LLM Data Agents},
author = {Roth, Zachary},
year = {2026},
month = {June},
url = {https://raintree.technology/writing/policystrata}
}Selected references
- [1] BEAVER: An Enterprise Benchmark for Text-to-SQL
- [3] XGrammar: Flexible and Efficient Structured Generation Engine
- [6] VeriEQL: Bounded Equivalence Verification for Complex SQL
- [15] PostgreSQL documentation: Row Security Policies
- [16] PICARD: Parsing Incrementally for Constrained Decoding
- [21] Spider: Cross-Domain Semantic Parsing and Text-to-SQL
- [22] Semantic Evaluation for Text-to-SQL with Distilled Test Suites
The PDF contains the complete 22-item bibliography.
PDF page preview
The research is readable in HTML above. Preview all 8 PDF pages here.








Supporting files
RepositoryView the source and tests on GitHubArtifact kitDownload the reproducible submission bundleSee how Raintree tests policy behavior in AI systems.
Raintree builds responsibility boundaries, regression tests, and human checkpoints into its products and developer tools.