Skip to content
AggregaAggrega
Select language: English

Aggrega Wasm Policy Socket schema

Generated reference. Do not edit by hand — regenerate from the published JSON Schema.

Schema id: https://aggrega.ai/schemas/wasm-policy-v1beta1.schema.json

The wire shapes a governance plugin attached at a verdict role consumes — PolicyInput at the ir-verdict role, RenderPolicyInput at the render-verdict role — and emits (PolicyOutput). A verdict of halt severity stops the build with a build-time diagnostic; a warn or info verdict is reported and the build continues. The IR-stage input graph is the full capability-agnostic IR graph, referenced from ir-v1beta1.schema.json rather than re-declared here, so the policy plugin sees the same node, edge, and attachment detail the compiler does; plugin authors track the IR schema version. The render-stage input carries the rendered output files instead of the graph. The Go, Rust and TypeScript payload types are generated from this schema into the plugin-ABI packages, so the three languages read and write one wire; a guest imports them from those packages, or through its plugin kit where the kit re-exports them.

One of the following shapes

  • PolicyInput
  • RenderPolicyInput
  • PolicyOutput

Definitions

PolicyInput

The payload static analysis hands to the policy socket: the full IR graph (the same shape the Topology Builder emits) plus the precalculated routing paths the analyzer enumerates alongside.

PropertyTypeRequiredDescription
graphIRGraphyesThe full capability-agnostic IR graph, single-sourced from ir-v1beta1.schema.json. The policy plugin reasons over the complete node/edge/attachment detail rather than a narrow projection.
precalculated_pathsPrecalculatedPath[]yesRouting paths the analyzer pre-enumerated so policies can reason about reachability without re-walking the graph.
sourcesPolicySource[]noDefinition files the host reads at compile time and hands to the plugin verbatim, as an ordered list sorted by path. The host reads the bytes as opaque content and does not parse them. Absent when the attachment declares no sources.
settingsobjectnoA free-form settings object the host hands to the plugin verbatim. The host does not parse or act on its content. Absent when the attachment declares no settings.

Additional properties are not permitted.

PolicyOutput

The response shape the policy plugin emits: the verdicts that fired during evaluation, one diagnostic per fired verdict. An allowing rule emits nothing, so an empty results array means no verdicts fired.

PropertyTypeRequiredDescription
resultsDiagnostic[]yesThe fired verdicts, one diagnostic each, in the order the plugin emits them. Empty when no verdict fired.
errorstringnoA failure message set when the guest ran but could not complete the operation; absent on success. It is distinct from any diagnostics the output carries: diagnostics report issues found during a run that still produced a result, while error reports that the operation itself did not complete. The host surfaces a present error as a failed plugin invocation.

Additional properties are not permitted.

RenderPolicyInput

The payload a governance plugin attached at the render-verdict role receives: the rendered output files the policy reasons over, in place of the IR graph.

PropertyTypeRequiredDescription
artifactsRenderedArtifact[]yesThe rendered output files the policy reasons over, as an ordered list sorted by path so the wire is byte-identical across runs of identical input.
sourcesPolicySource[]noDefinition files the host reads at compile time and hands to the plugin verbatim, as an ordered list sorted by path. The host reads the bytes as opaque content and does not parse them. Absent when the attachment declares no sources.
settingsobjectnoA free-form settings object the host hands to the plugin verbatim. The host does not parse or act on its content. Absent when the attachment declares no settings.

Additional properties are not permitted.

RenderedArtifact

One rendered output file: its path and the rendered content at that path.

PropertyTypeRequiredDescription
pathstringyesThe output path of the rendered file, relative to the render root.
contentstringyesThe rendered content at this path.
treeanynoThe parsed structured tree of this artifact, present when the host parsed the content before handing it to the plugin — the canonical JSON view of a source format the plugin does not read natively (an HCL artifact parsed to JSON, for example). The top level may be an object, an array, or a scalar, matching the parsed document’s own shape. Absent when the host did not parse the artifact, in which case the plugin reads the native content directly. The host pipes the tree through opaquely, carrying it verbatim without interpreting its content.
formatstringnoThe format the artifact was rendered in, present when the producing provider declared it. Absent when the producing provider declared no format.

Additional properties are not permitted.

PolicySource

One definition file handed to the plugin: its base-name path and the file’s content. Both are carried verbatim; the host does not parse the content.

PropertyTypeRequiredDescription
pathstringyesThe base name of the source file. The host supplies the base name only, never an absolute host path, so the wire is portable and deterministic.
contentstringyesThe source file’s content, carried verbatim as an opaque string.

Additional properties are not permitted.

PrecalculatedPath

One pre-enumerated routing path the analyzer materializes so policy rules can reason about reachability without re-walking the graph.

PropertyTypeRequiredDescription
path_idstringyesStable identifier for this path; deterministic across runs of identical input.
nodesstring[]yesOrdered sequence of node IDs the path traverses, from source to terminal.
attached_featuresstring[]yesAlphabetically sorted union of Feature type URIs attached to any node along the path. Set-membership semantics: a Feature appears once even if multiple nodes carry it. Empty when no node along the path carries any Feature attachment.

Additional properties are not permitted.