feat(schemas): add AgentPassport schema — five-class typed agent classification [T0-1] - #228
Merged
Merged
Conversation
…sification (T0-1) Anchor vocabulary object for the agent-system domain: the canonical typed classification for agents/services on SourceOS-managed hosts. Five-class model (system_core, intelligence_automation, app_helper, legacy_bridge, third_party) governing execution authorization, spatial permissions, and intelligence constraints. Downstream tranches import urn:srcos:agent-passport:* as a stable reference. - schemas/AgentPassport.json: schema v1.0.0 (draft 2020-12). Cross-field invariants enforced via allOf/if-then where JSON-Schema-expressible (intelligence_automation requires its 3 constraint fields; third_party cannot set system_bundle:true; suppress requires is_apple_signed); SHACL (T1-4) authoritative. - examples/agent-passport.json: collection covering system_core, intelligence_automation, third_party. - tools/validate_agent_passport_examples.py: validates every example element and asserts 5 rejection invariants (R1-R5) — a control observed refusing. - Makefile: validate-agent-passport-examples wired into validate. Closes #227
There was a problem hiding this comment.
Pull request overview
Adds a new normative AgentPassport JSON Schema (Tranche 0 anchor vocabulary) plus fixture examples and a repo-native validator, and wires the validator into make validate to keep downstream references to urn:srcos:agent-passport:* stable and checked.
Changes:
- Introduces
schemas/AgentPassport.json(draft 2020-12) defining the five-class agent classification model and several cross-field invariants. - Adds
examples/agent-passport.jsonas a multi-instance fixture (array) covering multiple agent classes. - Adds
tools/validate_agent_passport_examples.pyand wires it intoMakefilevalidation.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
schemas/AgentPassport.json |
New canonical schema for five-class agent classification plus cross-field constraints. |
examples/agent-passport.json |
Example passports (array) covering system_core, intelligence_automation, and third_party. |
tools/validate_agent_passport_examples.py |
Validator enforcing schema validity, example validity, and rejection invariants. |
Makefile |
Adds validate-agent-passport-examples target and includes it in validate. |
| from pathlib import Path | ||
| from typing import Any | ||
|
|
||
| from jsonschema import Draft202012Validator |
Comment on lines
+57
to
+65
| def main() -> int: | ||
| schema = load(SCHEMA_PATH) | ||
| Draft202012Validator.check_schema(schema) | ||
| validator = Draft202012Validator(schema) | ||
|
|
||
| # agent_class enum must contain exactly the five canonical values. | ||
| enum = set(schema["properties"]["agent_class"]["enum"]) | ||
| if enum != EXPECTED_CLASSES: | ||
| fail(f"agent_class enum must be exactly the five classes, got {sorted(enum)}") |
Comment on lines
+23
to
+26
| "pid": { | ||
| "type": "integer", | ||
| "description": "SESSION-SCOPED process id. NOT a stable identifier: it is reused across processes and reboots and must never be used for cross-session correlation or authorization." | ||
| }, |
| "legacy_bridge", | ||
| "third_party" | ||
| ], | ||
| "description": "Typed classification. system_core = _SYSTEM_CENTER_ daemons, highest privilege. intelligence_automation = proactive/prediction agents, constrained output. app_helper = application background daemons, standard user auth. legacy_bridge = legacy/modern connection bridge services. third_party = unsigned external applications." |
Comment on lines
+135
to
+154
| { | ||
| "$comment": "third_party must not claim system_bundle: true (class elevation).", | ||
| "if": { | ||
| "properties": { "agent_class": { "const": "third_party" } }, | ||
| "required": ["agent_class"] | ||
| }, | ||
| "then": { | ||
| "properties": { "system_bundle": { "const": false } } | ||
| } | ||
| }, | ||
| { | ||
| "$comment": "suppress_user_authorization_prompt: true is only valid when is_apple_signed: true.", | ||
| "if": { | ||
| "properties": { "suppress_user_authorization_prompt": { "const": true } }, | ||
| "required": ["suppress_user_authorization_prompt"] | ||
| }, | ||
| "then": { | ||
| "properties": { "is_apple_signed": { "const": true } } | ||
| } | ||
| } |
- CI 'Validate examples against schemas' crashed on the array-shaped example
(example.get('type') on a list). Split into one object per file, each with a
top-level type: AgentPassport discriminator, per the repo convention. Add the
optional 'type' const property to the schema.
- Copilot: pid minimum 0; clarify system_core description (drop _SYSTEM_CENTER_
placeholder); enforce SEAM-002 (third_party/app_helper/legacy_bridge cannot
suppress the auth prompt even when apple-signed) and SEAM-008 (attested_at
required when authorized_display_uuids asserted) via if/then; defensive
jsonschema import + enum access in the validator.
- Validator now globs the example files and adds rejection invariant R6.
Contributor
Author
|
Copilot review — all five evaluated and addressed (commit b549ca9):
Also fixed the CI failure (unrelated to Copilot): the |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implements T0-1 — the Tranche 0 anchor. Everything downstream imports
urn:srcos:agent-passport:*as a stable reference, so this merges first.What changed
schemas/AgentPassport.json(v1.0.0, draft 2020-12) — five-class typed host-agent classification. Identity (bundle_id/pid/binary_path),agent_classenum (exactly 5), boolean permission flags, spatial authorization arrays, intelligence constraints,capability_exceptions,interrupt_level, attestation.examples/agent-passport.json— collection coveringsystem_core,intelligence_automation, andthird_party.tools/validate_agent_passport_examples.py— validates every example element and asserts 5 rejection invariants.Makefile—validate-agent-passport-exampleswired intovalidate.Design decisions
allOf/if-thenwhere expressible (intelligence_automation requires its 3 constraint fields; third_party cannot setsystem_bundle: true;suppress_user_authorization_prompt: truerequiresis_apple_signed: true). The work order notes these "may not be expressible in JSON Schema" and defers to SHACL — SHACL (T1-4) remains authoritative, but this repo treats an un-enforced control as no control, so the expressible subset is enforced here too and proven by rejection tests.bundle_id,agent_class, the 4 permission flags,interrupt_level— matching the field set T5-1's good fixture implies, so downstream good fixtures stay valid.piddocumented as session-scoped, not a stable identifier.Exact commands run
Pass/fail output
validate_agent_passport_examples.py→OK: AgentPassport schema valid; 3 example passports validated (classes: intelligence_automation, system_core, third_party); 5 rejection invariants enforced (R1-R5)make validate-duplicate-schema-ids→OK: 323 unique schema $id valuesmake validate→OK: validate(full chain, exit 0)Rejection invariants proven (each fed to the schema, each rejected):
R1 third_party+
system_bundle:true· R2 unsigned suppression · R3 intelligence_automation missing a constraint field · R4 unknown class (anySource) · R5 missingbundle_id.Acceptance criteria
agent_classenum contains exactly five values (asserted by the validator)suppress_user_authorization_prompt: trueonly valid whenis_apple_signed: true(enforced + R2)third_partycannot havesystem_bundle: true(enforced + R1)intelligence_automationrequires all three intelligence constraint fields (enforced + R3)capability_exceptionsentries require all four fieldspiddocumented as session-scopedthird_partyand ≥1system_coremake validatepassesKnown gaps / deviations (explicit)
attested_at/attestation_sourcekept optional at the top level (not required), so downstream minimal good fixtures (T5-1) stay valid. The Known Gap "attestation timestamp required" is honored via the property descriptions and deferred to SHACL (T1-4) for class-conditional enforcement. Flagging this as a deliberate cross-tranche-consistency choice for review.capability_exceptions.expiresis optional and nullable (date-time or null).Blocked
Source: Tranche Work Orders v1.0 (2026-06-09). Closes #227.