This package accompanies the paper CARGO: Towards Row-Level Access Control in Natural Language Database Interfaces (anonymous submission). of Row-Level Security Policies* (anonymous submission). It contains the benchmark data, the full CARGO pipeline code, the prompts used in our experiments, the result tables, and reproduction scripts.
Text-to-RLS-Supplementary/
├── README.md ← this file
├── appendix/
│ └── supplementary.pdf ← extended appendix with derivations & extra figures
├── benchmark/
│ ├── requirements.json ← 490 natural-language authorization requirements
│ ├── reference_policies/ ← gold CREATE POLICY statements
│ ├── schemas/ ← 8 enterprise schemas (45 tables, 1,707 columns)
│ ├── runtime_context/ ← runtime variable spec + job-role vocabulary
│ └── executable_tests/ ← 3,037 PostgreSQL test cases over 481 evaluable items
├── code/
│ ├── extractor/ ← CodeS-3B + LoRA scope/anchor extractor (train + infer)
│ ├── retrieval/ ← Top-K reranker + Constraint-Guided ICL retrieval
│ ├── generation/ ← Frozen-LLM CREATE POLICY generator
│ └── evaluation/ ← RLSbench evaluation harness (7 metrics)
├── prompts/
│ ├── cargo_prompt.txt ← canonical CARGO 5-shot prompt template
│ └── baseline_prompts/ ← 0-shot · random · StructICL prompt JSONs
├── results/
│ ├── main_results.csv ← Table V — 7 metrics × 9 baselines + CARGO
│ ├── ablation_results.csv ← Tables VI/VII — pipeline & backbone ablations
│ └── per_item_results/ ← per-item pass/fail JSONs for the key configurations
└── scripts/
├── setup_database.sh ← initialise PostgreSQL and load schemas
├── run_evaluation.sh ← evaluate any predictions.json against RLSbench
└── reproduce_tables.sh ← regenerate main_results.csv & ablation_results.csv
# 1. Initialise PostgreSQL + load the 8 enterprise schemas
./scripts/setup_database.sh rlsbench
# 2. Reproduce the headline tables from the shipped per-item JSONs
./scripts/reproduce_tables.sh
# 3. Evaluate a fresh CARGO run against RLSbench
./scripts/run_evaluation.sh results/per_item_results/my_predictions.json rlsbench
NL requirement N + schema Σ + runtime context Ω
│
[code/extractor/] ──► CodeS-3B + LoRA (cascade, λ=0.4) produces (Ŝ, Â) top-K=3
│
[code/retrieval/rerank/] ──► schema-validity + decoding + parsimony → (Ŝ★, Â★)
│
[code/retrieval/icl/] ──► op-routed pool + MMR (k=5, μ=0.3) → R⁽ᵏ⁾
│
[code/generation/] ──► frozen DeepSeek-V3.2 produces CREATE POLICY …
│
[code/evaluation/] ──► run 3,037 tests → PCS / BA / IA / OPR / UPR / Sec@0FP / DDeny
| Natural-language requirements | 550 (490 single-policy + 60 bundled) |
| Reference CREATE POLICY statements | 640 |
| Enterprise schemas | 8 (45 tables, 1,707 columns) |
| Executable test cases | 3,037 across 481 evaluable items |
| Evaluation metrics | PCS, BA, IA, OPR↓, UPR↓, Sec@0FP, DDeny |
| System | PCS | BA | IA | OPR↓ | Sec@0FP | DDeny |
|---|---|---|---|---|---|---|
| Strongest closed-source baseline (Gemini-3.1-Pro 5-shot) | 0.813 | 0.635 | 0.252 | 0.399 | 0.454 | 0.758 |
| CARGO (DeepSeek-V3.2 frozen generator) | 0.979 | 0.861 | 0.599 | 0.181 | 0.748 | 0.961 |
See results/main_results.csv for the full 7-metric × 9-system table.
code/evaluation/evaluate.py directly from the test-case execution traces in results/per_item_results/.Code is released under the MIT License; data under CC-BY-4.0. Contact the authors via the submission system.
4 commits
Python
50.1%
PLpgSQL
49.0%
This package accompanies the paper CARGO: Towards Row-Level Access Control in Natural Language Database Interfaces (anonymous submission). of Row-Level Security Policies* (anonymous submission). It contains the benchmark data, the full CARGO pipeline code, the prompts used in our experiments, the result tables, and reproduction scripts.
Text-to-RLS-Supplementary/
├── README.md ← this file
├── appendix/
│ └── supplementary.pdf ← extended appendix with derivations & extra figures
├── benchmark/
│ ├── requirements.json ← 490 natural-language authorization requirements
│ ├── reference_policies/ ← gold CREATE POLICY statements
│ ├── schemas/ ← 8 enterprise schemas (45 tables, 1,707 columns)
│ ├── runtime_context/ ← runtime variable spec + job-role vocabulary
│ └── executable_tests/ ← 3,037 PostgreSQL test cases over 481 evaluable items
├── code/
│ ├── extractor/ ← CodeS-3B + LoRA scope/anchor extractor (train + infer)
│ ├── retrieval/ ← Top-K reranker + Constraint-Guided ICL retrieval
│ ├── generation/ ← Frozen-LLM CREATE POLICY generator
│ └── evaluation/ ← RLSbench evaluation harness (7 metrics)
├── prompts/
│ ├── cargo_prompt.txt ← canonical CARGO 5-shot prompt template
│ └── baseline_prompts/ ← 0-shot · random · StructICL prompt JSONs
├── results/
│ ├── main_results.csv ← Table V — 7 metrics × 9 baselines + CARGO
│ ├── ablation_results.csv ← Tables VI/VII — pipeline & backbone ablations
│ └── per_item_results/ ← per-item pass/fail JSONs for the key configurations
└── scripts/
├── setup_database.sh ← initialise PostgreSQL and load schemas
├── run_evaluation.sh ← evaluate any predictions.json against RLSbench
└── reproduce_tables.sh ← regenerate main_results.csv & ablation_results.csv
# 1. Initialise PostgreSQL + load the 8 enterprise schemas
./scripts/setup_database.sh rlsbench
# 2. Reproduce the headline tables from the shipped per-item JSONs
./scripts/reproduce_tables.sh
# 3. Evaluate a fresh CARGO run against RLSbench
./scripts/run_evaluation.sh results/per_item_results/my_predictions.json rlsbench
NL requirement N + schema Σ + runtime context Ω
│
[code/extractor/] ──► CodeS-3B + LoRA (cascade, λ=0.4) produces (Ŝ, Â) top-K=3
│
[code/retrieval/rerank/] ──► schema-validity + decoding + parsimony → (Ŝ★, Â★)
│
[code/retrieval/icl/] ──► op-routed pool + MMR (k=5, μ=0.3) → R⁽ᵏ⁾
│
[code/generation/] ──► frozen DeepSeek-V3.2 produces CREATE POLICY …
│
[code/evaluation/] ──► run 3,037 tests → PCS / BA / IA / OPR / UPR / Sec@0FP / DDeny
| Natural-language requirements | 550 (490 single-policy + 60 bundled) |
| Reference CREATE POLICY statements | 640 |
| Enterprise schemas | 8 (45 tables, 1,707 columns) |
| Executable test cases | 3,037 across 481 evaluable items |
| Evaluation metrics | PCS, BA, IA, OPR↓, UPR↓, Sec@0FP, DDeny |
| System | PCS | BA | IA | OPR↓ | Sec@0FP | DDeny |
|---|---|---|---|---|---|---|
| Strongest closed-source baseline (Gemini-3.1-Pro 5-shot) | 0.813 | 0.635 | 0.252 | 0.399 | 0.454 | 0.758 |
| CARGO (DeepSeek-V3.2 frozen generator) | 0.979 | 0.861 | 0.599 | 0.181 | 0.748 | 0.961 |
See results/main_results.csv for the full 7-metric × 9-system table.
code/evaluation/evaluate.py directly from the test-case execution traces in results/per_item_results/.Code is released under the MIT License; data under CC-BY-4.0. Contact the authors via the submission system.
4 commits
Python
50.1%
PLpgSQL
49.0%