Skip to content

feat: publish versioned JSON Schema for AWF config file #2374

Description

@lpcox

Problem

The AWF config file schema is currently defined only as a TypeScript interface (AwfFileConfig in src/config-file.ts) with ad-hoc runtime validation. This has several drawbacks:

  1. No external linkability — consumers like the gh-aw compiler cannot reference or validate config passed to AWF without duplicating the schema definition.
  2. No IDE support — users writing .awf.yml or .awf.json config files get no autocomplete or inline validation because there is no published $schema URL.
  3. No versioning contract — when new fields are added (e.g., apiProxy.models for model aliasing), downstream tools have no way to detect feature availability or validate against a specific AWF version.

Proposal

Publish a JSON Schema for the AWF config file that is:

  • Versioned — each AWF release publishes a schema at a stable URL (e.g., https://github.com/github/gh-aw-firewall/releases/download/v0.X.Y/awf-config.schema.json)
  • Generated from source — derived from the AwfFileConfig interface to stay in sync (e.g., using typescript-json-schema or zod-to-json-schema)
  • Linkable via $schema — users can add "$schema": "https://..." to their config for IDE validation
  • Consumable by gh-aw — the compiler can fetch the schema at compile time to validate the sandbox.config block in workflow frontmatter against the target AWF version

Implementation Notes

  • Consider generating from the existing AwfFileConfig interface in src/config-file.ts:5-67
  • The schema should include descriptions for each field (currently only in JSDoc on WrapperConfig in src/types.ts)
  • Publish as a release asset and/or at a latest URL for convenience
  • The $schema field is already allowed in the interface (line 6) but points nowhere today
  • gh-aw could use this to validate sandbox.config at compile time, catching typos and unsupported fields before runtime

Benefits

  • gh-aw compiler integration: validate config at compile time instead of failing at runtime
  • IDE autocomplete: VS Code, JetBrains, etc. pick up JSON Schema for .json/.yaml files
  • Documentation: schema serves as machine-readable API docs for the config surface
  • Breaking change detection: diff schemas between versions to identify incompatibilities

Activity

  1. added
    enhancement
    on May 1, 2026
  2. github-actions commented on May 1, 2026

    @github-actions
    Contributor

    👋 Hello! I noticed this issue might be related to an existing issue:

    Issue #2017 explicitly included a JSON Schema (docs/awf-config.schema.json) as one of its deliverables, along with $schema URL support for IDE autocomplete — which overlaps significantly with what this issue proposes.

    It's possible the JSON Schema deliverable from #2017 was already implemented (the issue is closed as completed), or it may have been deferred. If the schema wasn't published as part of that work, this issue makes sense as a follow-up focused specifically on versioning and gh-aw compiler integration. You may want to reference #2017 for prior context.

    This is an automated message from the issue duplication detector.

    Generated by Issue Duplication Detector for issue #2374 · ● 244.3K · ◷

  3. added a commit that references this issue on May 2, 2026
    08cd698
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancement

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions