OSCA Documentation
A complete reference for OSCA — Origin, Semantic, and Consequence Authority: the authorization model, the three tiers, the decision engine, the execution gateway, the invariants, the threat model, the architecture, the tests, and the simulation scenarios.
Overview
OSCA (Origin, Semantic, and Consequence Authority) is a multi-tier authorization architecture for autonomous AI agents. It separates authority into three independently verifiable tiers — origin, semantic, and consequence — and binds them atomically at execution time. Every authorized action carries an auditable decision trace from origin through consequence.
"The authority to act is not a single property. It is a chain of three independent warrants — who, what, and what-for — and each must hold."
Authorization Model
An action is authorized if and only if all three tiers pass. No tier can override another. This is the architectural invariant that distinguishes OSCA from single-tier authorization systems.
The Three-Tier Chain
Action(A) ──► Origin ──────► Semantic ──────► Consequence ──► Decision
(who) (what) (what-for)
Decision Outcomes
| Outcome | Condition |
|---|---|
| AUTHORIZED | All three tiers pass |
| DENIED | At least one tier fails |
| ESCALATED | A failed tier requests escalation |
Three Tiers
Tier 1 — Origin
| Field | Type | Required | Description |
|---|---|---|---|
| identity | str | Yes | Agent, user, or service identifier |
| credential | str | Yes | Token, certificate, or attestation |
| attestation | str | None | No | Optional hardware or software attestation |
| timestamp | datetime | Auto | UTC timestamp |
| nonce | str | None | No | Optional nonce for replay protection |
Failure modes: missing_identity, missing_credential.
Tier 2 — Semantic
| Field | Type | Required | Description |
|---|---|---|---|
| intent | str | Yes | Intent label (e.g., read_file) |
| scope | list[str] | Yes | Allowed targets (or *) |
| constraints | dict | No | Numeric or string constraints |
| preconditions | list[str] | No | Logical preconditions |
Failure modes: missing_intent, missing_scope, target_out_of_scope.
Tier 3 — Consequence
| Field | Type | Required | Description |
|---|---|---|---|
| effects | list[str] | Yes | Effects produced (e.g., file:read) |
| side_effects | list[str] | No | Secondary effects (e.g., log:write) |
| reversibility | str | Yes | reversible, irreversible, or conditional |
| audit_footprint | dict | No | Audit metadata |
Failure modes: missing_effects, invalid_reversibility.
Decision Engine
Aggregates the three tier verdicts into a single decision. If any tier fails,
the decision is not AUTHORIZED.
class DecisionEngine:
def decide(self, action, origin_verdict, semantic_verdict,
consequence_verdict, trace_id=""):
verdicts = (origin_verdict, semantic_verdict, consequence_verdict)
failed = [v for v in verdicts if not v.passed]
if not failed:
decision = Decision.AUTHORIZED
elif any("escalate" in v.reason.lower() for v in failed):
decision = Decision.ESCALATED
else:
decision = Decision.DENIED
return Authorization(decision=decision, tiers=verdicts, trace_id=trace_id)
Execution Gateway
Executes the action if and only if the decision is AUTHORIZED.
It does not re-evaluate the tiers.
class ExecutionGateway:
def execute(self, action, authorization):
if not authorization.authorized:
return ExecutionResult(
executed=False,
reason=f"Not authorized: {authorization.decision.value}",
)
try:
output = self._executor(action)
return ExecutionResult(executed=True, output=output, reason="ok")
except Exception as e:
return ExecutionResult(executed=False, reason=f"Execution error: {e}")
Invariants
| Invariant | Enforcement |
|---|---|
| Independence | Each tier receives only the Action; no tier reads another's verdict |
| Non-Override | DecisionEngine requires all three to pass |
| Atomicity | ExecutionGateway refuses if not AUTHORIZED |
| Traceability | Authorization carries trace_id; TierVerdict carries evidence |
| Binding | ActionBinding cryptographically links action to authorization |
| Replay Resistance | ReplayProtection tracks nonces |
Threat Model
| ID | Threat | OSCA defense |
|---|---|---|
| T1 | Identity spoofing | Origin checks identity + credential |
| T2 | Scope escalation | Semantic checks target in scope |
| T3 | Consequence concealment | Consequence requires declared effects |
| T4 | Tier collusion | Non-override: all three must pass |
| T5 | Replay | Nonce + ReplayProtection |
| T6 | Authorization tampering | ActionBinding |
| T7 | Escalation abuse | Governance policy (out of scope) |
| T8 | Audit log tampering | Deployment layer (out of scope) |
Architecture
OSCA/
├── core/
│ ├── action.py # Action (verb, target, params)
│ ├── authorization.py # Authorization, Decision, TierVerdict
│ ├── decision_engine.py # DecisionEngine
│ └── execution_gateway.py # ExecutionGateway, ExecutionResult
├── authority/
│ ├── origin.py # Origin tier
│ ├── semantic.py # Semantic tier
│ └── consequence.py # Consequence tier
├── governance/
│ ├── policy.py
│ ├── delegation.py
│ ├── escalation.py
│ └── audit.py
├── security/
│ ├── action_binding.py
│ ├── provenance.py
│ └── replay_protection.py
├── simulation/
│ ├── runner.py
│ ├── __main__.py
│ ├── scenarios/
│ ├── agents/
│ └── attacks/
├── tests/
├── DOCS/
│ ├── authorization_model.md
│ ├── architecture.md
│ └── threat_model.md
└── RESEARCH_PAPER/
└── OSCA_Research_Paper.pdf
Testing
OSCA's test suite: 51 tests across 7 files.
| File | Tests | Focus |
|---|---|---|
| test_origin.py | 8 | Origin tier |
| test_semantic.py | 8 | Semantic tier |
| test_consequence.py | 7 | Consequence tier |
| test_authorization.py | 8 | Decision engine |
| test_escalation.py | 5 | Escalation record |
| test_execution_binding.py | 7 | Gateway + binding |
| test_adversarial.py | 8 | Adversarial |
| Total | 51 | 51/51 passing |
Run the full suite:
make test
Simulation
5 end-to-end scenarios, executed by:
python3 -m simulation
| Scenario | Expected |
|---|---|
| happy_path | Authorized action executes |
| scope_escalation | Out-of-scope denied |
| tier_collusion | Two-tier collusion blocked |
| replay_attack | Replay rejected |
| tamper_attack | Tampering detected |
All 5 pass at Phase I.
Limits & Non-Goals
What OSCA supports
- Three independently verifiable authority tiers.
- Atomic execution binding.
- Cryptographic action-to-authorization binding.
- Replay protection via nonces.
- Decision traceability.
What OSCA does not support
- Formal semantic equivalence proofs.
- Runtime monitoring of undeclared effects.
- Cross-language generalization.
- Adversarial isolation (OS-level sandboxing).
- Formal verification of the non-override invariant.
Repository Structure
OSCA/
├── README.md
├── CHANGELOG.md
├── VERSION
├── LICENSE
├── CITATION.cff
├── pyproject.toml
├── setup.py / setup.cfg
├── requirements.txt
├── Makefile
├── MANIFEST.in
│
├── core/
├── authority/
├── governance/
├── security/
├── simulation/
├── tests/
├── DOCS/
├── RESEARCH_PAPER/
├── PUBLICATION/
└── dist/
Citation
Zenodo Archive
@software{baladi2026osca_zenodo,
author = {Baladi, Samir},
title = {{OSCA}: Origin, Semantic, and Consequence Authority —
A Multi-Tier Authorization Architecture for Autonomous AI Agents},
year = {2026},
publisher = {Zenodo},
version = {0.1.0-research-draft},
doi = {10.5281/zenodo.23851837},
url = {https://doi.org/10.5281/zenodo.23851837},
note = {Ronin Institute / Rite of Renaissance}
}
APA (inline)
Baladi, S. (2026). OSCA: Origin, Semantic, and Consequence Authority — A Multi-Tier Authorization Architecture for Autonomous AI Agents (Version 0.1.0-research-draft). Zenodo. https://doi.org/10.5281/zenodo.23851837
Status
| Component | Status |
|---|---|
| Formal model | Defined |
| Architecture | Specified |
| Authorization model | Specified |
| Threat model | Specified (8 threats) |
| Implementation (6 layers) | Complete |
| Tests | 51/51 passing |
| Simulation | 5/5 scenarios passing |
| Empirical validation | Not started |