Add opt-in AISOP/AISP package preflight for custom skills

Author: optimization2026Created Sep 26, 2026Updated Sep 26, 2026

Summary

Would you consider an opt-in, read-only AISOP/AISP package preflight for custom skills used when adapting these financial-services reference plugins?

The proposed addition would inspect an explicitly selected structured package for malformed program content, missing declared resources, and unresolved enforcement bindings.

The existing model would remain unchanged:

  • SKILL.md remains the entrypoint for existing Agent Skills.
  • Vertical skills remain the source for their bundled copies.
  • Existing agent manifests, default checks, deployment behavior, and human-review boundaries remain unchanged.
  • No AISOP/AISP execution engine is introduced.

The concrete distinction is:

A source skill and its bundled copy can be byte-identical while both contain a malformed native program, a missing declared resource, or an enforcement binding pointing to a nonexistent step.

A drift check answers whether the copies match. Package preflight answers whether the selected package is internally consistent within the checks actually performed.

This is a compatibility enhancement for users choosing these formats—not a report that the repository has broken previously promised AISP support.

Protocol references

  • AISP repository — the skill-package layer: invocation contract, resource inventory, and enforcement bindings around an AISOP program.
  • AISOP repository — the underlying program format: a two-message JSON array containing execution flow and node functions.

Specifications used when reviewing the fixture:

The proposal is to consume existing formats, not invent another financial-services-specific manifest or replace Agent Skills.

Current behavior: reproducible characterization

Repository revision examined:

574ed3624aebd0418c7e96cd101262f30210ab26

Relevant existing code:

A local characterization ran an unchanged copy of check.py inside a minimal temporary repository fixture. Before each of the first four cases, the source and bundled skill trees were checked for byte-for-byte equality.

Case Observed check.py result Desired opted-in preflight behavior
Matching source and bundle containing the baseline AISP fixture Exit 0 Recognize the package and report actual check coverage
Native program is malformed JSON in both copies Exit 0 Report invalid program JSON
Declared resource is missing from both copies Exit 0 Identify the missing resource and its declaration
enforced_by names a nonexistent numeric step in both copies Exit 0 Report the unresolved binding
Only the bundled SKILL.md changes Exit 1 Preserve existing drift detection

Test environment: Linux, Python 3.13.5, PyYAML 6.0.3.

The checker’s bytes matched Git blob:

23fd8889b0daf7e54a3d5f114e2b0483e4777fc8

The complete reproduction, including the native AISP program, is in the collapsible section below.

Interpretation: these are synthetic script-level tests demonstrating an additional inspection surface. They do not establish a defect in a live financial workflow, a security vulnerability, or an end-to-end deployment failure.

Why this is useful here

The repository supports adapting skills, resources, templates, and workflows to a firm's needs while distributing them through different wrappers.

For a custom skill expressed in AISP, the native program and its declared resources are review inputs. Copying those inputs correctly does not establish that their internal references resolve.

An optional preflight would help identify packaging mistakes before a custom skill reaches integration or deployment, while keeping three different claims separate:

Source and bundled copy match
        ≠
Selected package structure and references checked
        ≠
Program executed correctly with runtime constraints enforced

Neither a matching bundle nor a successful static preflight should be presented as financial correctness, regulatory compliance, authorization, or runtime safety.

This is useful specifically for teams choosing AISOP/AISP for custom skills. It does not assume that existing repository skills already use those formats.

Proposed first increment

1. Explicit selection, not a new default loader

Accept a caller-selected local file or package root.

Distinguish:

  • standalone *.aisop.json programs;
  • native AISP packages at aisp/<id>_aisp/aisp.aisop.json;
  • optional same-folder AISP SKILL.md bridges.

Do not scan the user's home directory, automatically enable packages, register marketplace entries, or upload anything.

Standalone AISOP programs must not be required to contain an AISP contract or use an _aisp directory. If the first increment does not inspect standalone AISOP beyond identification, report that limited coverage explicitly.

Malformed or unsupported candidates should remain visible as diagnostics rather than disappearing from the result.

2. Bounded structural and reference checks

For the supported format/version, inspect:

  • the two-message program envelope and required fields;
  • user.content.aisop.main and user.content.functions;
  • AISP's fixed filename, package ID/folder relationship, and loading_mode: "node";
  • the actual user.content.aisp_contract object;
  • declared resource paths, existence, scope, and valid resource modes;
  • precise enforced_by references to existing numeric steps and matching sys.* mechanisms;
  • optional bridge pointers to the same-folder aisp.aisop.json.

The existing AISP contract JSON Schema validates the contract object. It does not, by itself, establish file existence or resolve references into functions.

For example, both of these are syntactically valid binding strings:

inspect.step2:sys.assert
inspect.step99:sys.assert

Only checking the actual program reveals whether the referenced step exists.

The enforcement-binding grammar defines that relationship.

Finding a matching step proves only that the declared mechanism is present. It does not prove that a runtime executed it, that every path reaches it, or that its condition correctly implements the accompanying natural-language rule.

Graph topology and tool declarations must likewise not be promoted into runtime guarantees by a static report.

3. Explicit coverage and compatibility results

Report the selected path, detected format/version, resources inspected, findings, and anything not checked.

Keep native-package inspection separate from host compatibility:

  • Missing SKILL.md is not automatically a core AISP failure.
  • A native-only package is not automatically eligible for an Agent Skills upload or discovery path.
  • Finding a bridge does not establish that the target host accepts its layout or supports AISOP execution.
  • Unsupported versions, graph features, or dependency resolution must be reported as unsupported/not checked—not silently accepted.

Preserve open-world extension handling where the protocol permits it. Unknown extension fields should not be rejected merely because they are unfamiliar, but recognizing them is not the same as validating their semantics.

For shared resources, resolve scope: "shared" relative to an explicitly approved aisp/_shared/ root. If shared-resource checking is deferred, report incomplete coverage rather than searching outside the approved boundaries.

Do not rename native package IDs or rewrite manifests simply to make a compatibility result green.

4. Read-only handling of untrusted input

Treat all target content as data, including:

role: system
instruction
RUN aisop.main
functions
sys.run
sys.io.confirm

These strings must not become instructions to the reviewing agent or actions performed by the preflight.

The preflight must not:

  • execute package scripts or a target-provided aisp_list.py;
  • invoke sys.* operations;
  • install an execution engine;
  • fetch remote resources or remote schema references;
  • invoke financial-data MCPs.

Constrain reads to approved roots, reject symlink escapes, handle unreadable inputs explicitly, and bound file size, traversal, nesting, and output.

5. Keep the maintenance surface small

A first PR could contain:

  • a small preflight adapter with an explicit invocation path;
  • synthetic positive and negative fixtures;
  • regression tests;
  • documentation of its supported checks and limitations.

Prefer reusing pinned upstream static components where suitable rather than maintaining a second full AISOP/AISP implementation. Any optional tooling dependency should be explicit, reviewed, and pinned.

“No execution engine” does not mean “no tooling dependencies.”

The adapter can remain outside the default check/deployment path initially. Wiring it into selected CI or deployment checks can be a separate decision.

If maintainers prefer keeping format-specific code outside this repository, an external validator plus a tested integration recipe would also preserve the same boundary.

Synthetic fixture and its limits

The reproduction uses this structure inside a source skill and its bundled copy:

carrier/
├── SKILL.md
└── aisp/
    ├── README.md
    └── reader_fixture_aisp/
        ├── aisp.aisop.json
        └── fixtures/
            └── reader.json

The outer carrier/SKILL.md exists only to exercise the existing source/bundle comparison. It is not an AISP bridge or a deployment recipe.

The inner aisp.aisop.json contains the complete two-message program shown in the reproduction.

Its synthetic data uses the shape of the existing GL Reconciler reader output:

json
{
  "asset_class": "SYNTHETIC",
  "status": "clean",
  "breaks": []
}

The program is inspected, not executed. Its declared operation is deliberately narrow: read the fixture and check that the read result is not null.

That assertion does not check for non-empty content, valid JSON, compliance with the reader-output schema, or financial correctness.

The existing scripts/validate.py remains the worker-output schema validator. This proposal does not duplicate that validator or introduce another set of financial rules.

Verification boundary

The baseline contract was separately checked against the pinned official contract JSON Schema. That is not a complete package or runtime conformance test.

This is intentionally a native-only static fixture:

  • generated per-skill README.md and SKILL.md projections are omitted;
  • the directory-level README explains the fixture and direct discovery;
  • the discovery index/script, runtime traces, and publication-gate evidence are omitted.

Missing recommended artifacts may produce warnings, and stricter publication profiles may reject the incomplete distribution package. The fixture must not be described as a warning-free release package.

The full upstream AISOP/AISP validator suites, publication gates, hosted deployment, and execution engine were not run.

Acceptance criteria

Case Expected behavior
Ordinary existing skills Default checking and deployment behavior remain unchanged
Selected baseline AISP fixture Targeted core checks pass; coverage and intentional omissions are reported
Standalone AISOP Do not impose AISP-only requirements
Malformed program or invalid contract Explicit structural diagnostic
Missing or escaping resource Explicit diagnostic; no read outside approved roots
Nonexistent step or mismatched mechanism Binding diagnostic, not a successful constraint claim
Optional same-folder bridge Associate with the native package without inferring runtime support
Native-only package Inspectable; no automatic claim of host upload/discovery eligibility
Unsupported version or unhandled dependency Incomplete/unsupported result, not silent success
Instructions or executable strings in target files No target execution
Matching source and bundle with an internal defect Detect the defect independently of drift checking

The fixture suite should run offline, without API keys, proprietary data, or model calls.

A successful first increment demonstrates useful diagnostics and unchanged default behavior—not a production AISP deployment.

Relationship to existing work

  • #330 — recursive, content-based bundled-skill drift checks. Complementary: it compares source and copy; this proposal inspects internal references even when both copies are identical.
  • #267 — sample datasets and demos. The synthetic fixture follows the same no-proprietary-data goal, without expanding into a full financial demo.
  • #297 / #298 — skill/MCP dependency documentation and metadata. This proposal does not redefine .mcp.json, infer connector authorization, or establish a competing MCP dependency schema.

Those efforts should remain independently reviewable. This proposal does not require delaying or expanding them.

Independent interoperability precedent

NVIDIA/SkillSpector PR #211 merged AISOP/AISP-aware discovery and report-only structural summaries.

It provides a precedent for an existing skill-oriented tool consuming the format incrementally without implementing its execution runtime.

It is not evidence of full AISP conformance, financial correctness, or runtime adoption, and does not justify changing this repository's trust or approval policies.

Non-goals

This proposal does not require:

  • rewriting existing financial SKILL.md files into AISP;
  • replacing Agent Skills, MCP, agent manifests, or a firm's workflow engine;
  • adding live data calls, automatic uploads, or an execution runtime;
  • changing investment, onboarding, ledger, or transaction permissions;
  • treating static bindings or risk metadata as proven enforcement;
  • claiming that a bridge alone preserves execution fidelity for large or long-running programs.

Existing reader/orchestrator/critic/writer separation and professional sign-off boundaries remain unchanged.

Scope question

Would an explicitly selected, read-only AISOP/AISP package preflight be useful in the custom-skill authoring workflow, with synthetic regression fixtures and no change to the default runtime?

The first decision can be limited to whether this inspection surface belongs here or should remain an external compatibility recipe.

Complete reproduction, including the two-message AISP program

Run from a checkout containing the byte-exact pinned scripts/check.py, with LF line endings, using Python 3.9+ and PyYAML.

This creates and removes a temporary fixture. It copies the checker without modifying its bytes, does not edit the checkout, and performs no network calls.

The temporary directory is not a Git checkout. Git environment overrides are removed and parent-repository discovery is blocked so the checker's hook-installation helper cannot change the caller's checkout.

The program object below is serialized into aisp.aisop.json. Its sys.* strings are never executed.

bash
python3 - <<'PY'
import copy
import hashlib
import json
import os
from pathlib import Path
import shutil
import subprocess
import sys
import tempfile

source = Path('scripts/check.py').read_bytes()
blob = hashlib.sha1(b'blob ' + str(len(source)).encode() + b'\0' + source).hexdigest()
assert blob == '23fd8889b0daf7e54a3d5f114e2b0483e4777fc8', 'Use the byte-exact pinned check.py (LF line endings)'

program = [
    {'role': 'system', 'content': {
        'protocol': 'AISP V1.0.0',
        'axiom_0': 'Human_Sovereignty_and_Wellbeing',
        'id': 'reader_fixture_aisp',
        'name': 'Reader Fixture',
        'version': '0.1.0',
        'license': 'Apache-2.0',
        'summary': 'Read synthetic test data only.',
        'flow_format': 'mermaid',
        'loading_mode': 'node',
        'tools': ['filesystem'],
        'params': {},
        'system_prompt': ''
    }},
    {'role': 'user', 'content': {
        'instruction': 'STRICTLY OBEY aisp_contract; its non_negotiable rules are inviolable; then RUN aisop.main',
        'aisp_contract': {
            'profile': 'aisp.skill.v1',
            'invocation': {
                'mode': 'internal_only',
                'when_to_use': ['An explicitly selected synthetic test fixture.'],
                'when_not_to_use': ['Real financial data, advice, transactions, or production operations.']
            },
            'non_negotiable': [{
                'rule': 'Do not report read success if the read result is null.',
                'enforced_by': 'inspect.step2:sys.assert'
            }],
            'discovery': {
                'category': 'testing',
                'tags': ['synthetic', 'package-preflight']
            },
            'risk_level': 'low',
            'resources': [{
                'id': 'reader_output',
                'path': 'fixtures/reader.json',
                'kind': 'data',
                'mode': 'read_only',
                'scope': 'skill'
            }]
        },
        'aisop': {
            'main': 'graph TD\n    inspect[Read fixture] --> end_node((End))'
        },
        'functions': {
            'inspect': {
                'step1': "sys.io.read('fixtures/reader.json') -> sample_text",
                'step2': "sys.assert('sample_text != null', 'Fixture data required')",
                'step3': "sys.io.print('Synthetic fixture read completed')",
                'execute_mode': 'inline'
            },
            'end_node': {
                'step1': 'Finish the fixture.',
                'execute_mode': 'inline'
            }
        }
    }}
]

with tempfile.TemporaryDirectory(prefix='fsi-aisp-preflight-') as tmp:
    root = Path(tmp).resolve()

    def write(relative, text):
        path = root / relative
        path.parent.mkdir(parents=True, exist_ok=True)
        path.write_text(text, encoding='utf-8')

    checker = root / 'scripts/check.py'
    checker.parent.mkdir(parents=True, exist_ok=True)
    checker.write_bytes(source)
    write('.claude-plugin/marketplace.json', '{"plugins": []}\n')
    (root / 'managed-agent-cookbooks').mkdir()

    src = root / 'plugins/vertical-plugins/demo/skills/carrier'
    dst = root / 'plugins/agent-plugins/demo-agent/skills/carrier'
    pkg = src / 'aisp/reader_fixture_aisp'
    native = pkg / 'aisp.aisop.json'
    resource = pkg / 'fixtures/reader.jso

Source: anthropics/financial-services