Purpose
A Golden Corpus is a small, curated set of test cases used to validate that TealTiger policies behave deterministically and as intended. This document explains:- What a golden corpus is
- Why it is essential for governance
- How to design one effectively
- When it should be updated
What Is a Golden Corpus?
A golden corpus is a collection of input contexts and expected outcomes that serve as the canonical source of truth for policy behavior. Each test case answers:- Given this input
- Under this policy version
- The decision must be exactly this
Why Determinism Requires a Golden Corpus
TealTiger is designed around deterministic enforcement: Same inputs → same policy → same decision Without a golden corpus:- Policy changes become risky
- Regressions go unnoticed
- Audit confidence erodes
- “It worked yesterday” becomes common
- Every change is intentional
- Every decision is reproducible
- Every audit trail is defensible
What Belongs in a Golden Corpus
A good golden corpus is small but representative. At minimum, include the following case types:- Allow case
- Deny case
- Modify case
- Redact case
- Missing input case
- Boundary case
- Environment case
Canonical Test Case Structure
Example Golden Corpus
Test Case 01 — Allow (Baseline Safe Case)
Description: Trusted identity performing an allowed action in production. Policy Version: v1.1.0
Category: Security Input Context:
- env: prod
- identity.role: trusted_service
- request.intent: inference
- tool_access: false
- SEC_ALLOW_TRUSTED_BASELINE
- none
- decision = allow
- environment = prod
Test Case 02 — Deny (Clear Policy Violation)
Untrusted identity attempting tool access in production. Policy Version: v1.1.0
Category: Security Input Context:
- env: prod
- identity.role: untrusted
- request.intent: tool_use
- tool_access: true
- SEC_TOOL_ACCESS_UNTRUSTED_PROD
- none
- decision = deny
- severity = high
Test Case 03 — Modify (Deterministic Clamp)
Free‑tier request exceeding token limit. Policy Version: v1.1.0
Category: Cost Input Context:
- env: prod
- budget_class: free
- requested_max_tokens: 8192
- COST_TOKEN_CLAMP_FREE_TIER
- max_tokens = 2048
- decision = modify
- cost_class = free
Test Case 04 — Redact (Sensitive Data Handling)
Request flagged as containing PII. Policy Version: v1.1.0
Category: Security Input Context:
- env: prod
- request.contains_pii: true
- SEC_REDACT_PII_FIELDS
- none
- redaction_applied = true
Test Case 05 — Missing Input (Safe Default)
Required identity field is missing. Policy Version: v1.1.0
Category: Security Input Context:
- env: prod
- identity: missing
- INPUT_MISSING_IDENTITY
- none
- decision = deny
- failure_type = missing_input
Test Case 06 — Boundary Condition
Requested tokens exactly at the allowed threshold. Policy Version: v1.1.0
Category: Cost Input Context:
- env: prod
- budget_class: standard
- requested_max_tokens: 4096
- COST_TOKEN_ALLOW_AT_LIMIT
- max_tokens = 4096
- decision = allow
Rules for Maintaining the Golden Corpus
- Update the corpus only when behavior changes intentionally
- Never update the corpus to “fix” failing tests
- Add new cases for new policies or thresholds
- Do not remove cases without explicit review
Review Checklist
- All golden corpus cases pass
- New behavior has new test cases
- Reason codes are explicit and stable
- Boundary conditions are covered
- Missing‑input behavior is deterministic
Summary
The golden corpus is the proof system for deterministic governance. If policies define what should happen,the golden corpus proves that it always does.

