Est.

Declaring Agents in YAML Without a Python Runtime as a Governance Prerequisite

YAML agent definitions can be reviewed before anything runs.

· 8 min read
Cover illustration for “Declaring Agents in YAML Without a Python Runtime as a Governance Prerequisite”
Agent Governance · November 9, 2026 · 8 min read · 1,891 words

Declaring agents in YAML without a Python runtime makes the agent definition a governance artifact. For agents-as-code, AI coding agents defined as YAML config files in version control can pass through normal review before a model or tool runs. The prerequisite is a persistent declaration that connects approved behavior to scoped permissions, auditable identity, execution bounds, and reproducible configuration.

Why agent definition in code is ungovernable at scale

Engineering teams with well-established practices use version control, review, and approval for production artifacts, but agent definitions can slip past those checks even when the code that creates them lives in a repository. A constructor brings together the instructions, model selection, tools, and permissions in the program that creates the agent. The source is inspectable, but the resulting agent definition may depend on execution. Reviewers must reconstruct what that program will produce. That is a different task from approving a complete declaration of what an agent may do.

Altering instructions or tools means modifying and redeploying implementation code, so behavioral changes compete with ordinary software changes for review attention. Governance has no separate artifact to approve. A policy intended to govern an agent must instead attach to the code that constructs it, with the agent’s effective configuration still to be resolved. The faster teams make those changes, the easier it becomes for configuration changes to pass without a review of their own.

AgentKernel describes the underlying problem as an infrastructure gap. Traditional applications get operating-system mechanisms such as process isolation, mandatory access control, and identity namespaces, while agents often depend on application-level middleware that runs inside a shared process boundary. That boundary limits what middleware can enforce independently. More policy inside the same process does not supply the missing separation between the agent and its governing authority. Before that authority can approve an agent, it needs a concrete definition to inspect.

What YAML declaration actually does to an agent definition

Moving the definition into YAML changes its representation from construction logic to data. A human or automated process can read that data without executing the program that would otherwise assemble it. The definition exists before the agent runs. Parsing and validating the declaration without a Python runtime can therefore be an offline act, separate from contacting a model or invoking a tool.

Google’s Agent Development Kit offers a YAML loader that constructs the same agent a Python constructor would. Microsoft’s Agent Framework provides Microsoft.Agents.AI.Declarative with CreateFromYamlAsync, while Agent Format defines a runtime-agnostic.agf.yaml standard. These approaches converge on the same representational boundary. The agent’s declaration belongs in a document, and a runtime consumes that document. These are ways to use declarative definitions, though they need not have the same runtime requirements or support the same governance controls.

The separation also clarifies what belongs in each layer. YAML describes the agent’s instructions, model, tools, and declared limits, while Python or another runtime implements the tools and execution machinery. Behavior can change without rewriting that machinery. A reviewer who understands the agent’s purpose can read and propose changes to its declaration without navigating constructor code. The practical selection criterion is therefore whether the definition can be read and validated before execution, rather than whether a framework merely accepts YAML somewhere in its setup.

How do you store YAML agent definitions in Git for normal review and approval?

A YAML definition in version control gives reviewers a direct diff of the agent’s declared behavior. Changes to instructions, models, tools, and limits become changes to an identifiable artifact rather than implications buried in implementation logic. Branch protection, required reviewers, and merge gates can control changes to that file through the same process used for application code. Reviewers still need to understand the proposed behavior, but they need not know the framework’s construction API to locate it.

An agent proposing a change to its specification produces a pull-request-shaped object, subject to review rather than automatic authority over its own definition. Approval remains separate from proposal. A Deterministic Control Plane for LLM Coding Agents extends this approach into a managed supply chain through SHA-256 content addressing, lockfiles stamped with keyed message authentication codes, and hash-chained audit logs. Those mechanisms attach provenance to configuration, treating rules that steer write and execute access with the rigor applied to software dependencies.

The same paper’s 2026 prevalence study found that 75.5% of agent configuration clone pairs came from different organisations. Its finding concerns configuration propagation. Nevertheless, copying creates an attribution problem when configuration enters a repository without a managed history of acceptance. Git provides somewhere to record that decision. Version-controlled YAML can establish who changed a definition, when the change occurred, and under what approval, but placing a copied document in a repository does not itself establish its upstream provenance.

Why version-controlled YAML is the only way to scope agent permissions before runtime

Permission scoping requires an explicit declaration that a policy engine can read before the agent acts. In a YAML-first workflow, the version-controlled definition supplies that declaration without requiring the construction program to run. The essential requirement is a human-readable, pre-runtime policy artifact, with YAML serving as the common format for the agent definition. The format makes this arrangement practical, while the declaration and enforcement boundary make it governable.

The prevalence study found that fewer than one percent of agent configurations declared permission boundaries, compared with 33% of CI/CD workflows in the same repositories. The paper qualifies this comparison as indicative because the permission parser was fragile. Even with that limitation, the contrast exposes an uneven practice. Teams already express permissions explicitly for workflows, yet agent configuration often lacks an equivalent boundary. The same study found that most agent configuration files had only a single commit, which suggests that these files also get few updates over time.

Declared YAML policies can match tool names, annotations, input parameters, and cumulative state, and can route irreversible actions to approval before execution. This supports narrower authority than giving every agent the permissions of the most trusted developer. An advisor agent should not need shell access. A contributor agent should not need production database credentials merely because another role can use them. These distinctions must be explicit before a control plane can enforce them.

AgentKernel argues that mandatory, non-bypassable enforcement must sit outside the agent’s shared process boundary. YAML gives that external authority an inspectable definition before any tool invocation. Declaration supplies the scope against which enforcement operates, including the declared intent needed for graduated perception, information-flow-controlled memory, and semantic-to-kernel execution enforcement.

How YAML declaration gives agents auditable identity

Once permissions are declared, an audit can connect an action to the configuration that authorized it. A persistent YAML definition provides a canonical object that reviewers can inspect, compare, and approve independently of execution. An agent name alone cannot provide that evidence. AgentKernel identifies self-declared identity strings in a shared namespace, without provenance, as a source of the agent trust gap. A versioned definition linked to cryptographic provenance makes identity attributable.

That attribution changes what an execution record can explain. Tool calls, diffs, and actions can be logged against the particular definition under which the agent operated. OpenTelemetry’s GenAI semantic conventions define a canonical span schema for LLM and agent operations through the gen_ai.* attribute namespace, although those conventions remain at Development status. Such spans become more useful for governance when they attach to a declared agent identity.

RepoComplianceBench found that agents almost never proactively retrieved contribution rules. This supports putting governing instructions in the agent’s context so the agent has them without having to find them. Availability is not the same as retrieval. Pre-loaded declarations can provide that context, while human-readable rules documents in non-YAML formats illustrate the same need.

Formal governance also depends on retained evidence. ISO/IEC 42001 Clause 9.1 requires organizations to monitor and measure their AI Management System and retain documented evidence of results. NIST’s AI Agent Standards Initiative, launched in February 2026, focuses through CAISI on identity, authorization, security, and interoperability. These concerns align with inspectable definitions and attributable execution. YAML provides a stable object around which evidence can be organized.

Why completion and safety are orthogonal without declared execution bounds

Task completion measures whether an agent achieved an outcome. Research on agent behavior found that 66.22% of runs in an agentic benchmark were simultaneously task-complete and unsafe. An agent can reach the requested result through tools or actions that should have been outside its scope. Without explicit bounds, a successful outcome offers no dependable evidence that the route to it was acceptable.

Declared execution limits give a control plane a separate way to judge how the agent reached that result. A phase state machine constrains permitted progression, a tool allowlist limits available operations, and a budget cap bounds resource use. Each requires a scope established before execution. The deterministic control plane paper proposes enforced phase state machines and requirement-to-file-to-test traceability, while distinguishing post-hoc traceability auditing from fully enforced pre-execution checks. That distinction prevents an audit record from being mistaken for a preventive control.

The paper also proposes hard caps on self-correction loops because empirical work shows that LLM debugging effectiveness decays sharply within a small number of attempts. Unbounded retries are consequently a process risk and a cost risk. Running more does not always give better evidence. A declared limit tells the governing system when to stop, even if the agent keeps trying to complete the task. The control does not need to infer that condition from an unsuccessful history after resources have already been consumed.

Budget-Aware Agency treats computational budget as an active control signal. That signal requires a declared budget available before model invocation. Gateway-layer controls follow the same logic. Per-session, per-developer, and per-time-period caps must exist in managed configuration before they can constrain spending. YAML puts those bounds in the definition that reviewers can check, so safety and resource use can be judged before the work is done as well as after.

What reproducible execution requires from agent configuration

To make execution reproducible, teams need a stable record of which agent definition ran. With construction code alone, that account depends on the runtime environment, dependencies, and constructor arguments being pinned consistently. YAML creates a separate object to identify. Content-addressed provenance can establish the exact configuration version independently of the program that loads it. This makes the approved definition reproducible independently of execution, while model outputs may still vary and runtime dependencies remain.

Open Agent Spec provides an oa:// registry with the same YAML specifications runnable from multiple language runtimes, explicitly including Node.js with no Python required. The governance artifact can therefore outlive a particular runtime choice. Rel(AI)Build uses SHA-256 content addressing and lockfiles stamped with keyed message authentication codes to give configuration versions tamper-evident identity. These mechanisms connect reproducibility to provenance. The relevant guarantee is that a particular declared configuration can be identified and used again.

That distinction supports promotion from development to staging to production. Agents can be triggered from CI or GitHub Actions using the same YAML specification that passed review, so the approved artifact and the execution input are identical. Approval then has a durable referent across environments. Permissions, identity, and execution limits can all attach to that same version instead of becoming separate assertions that must be reconciled afterward. Declaring the agent outside its runtime is what lets governance operate as one coherent system, from the proposed change to the evidence of what ran.

Sources

  1. AgentKernel: The Trust-Native Agentic Operating System
  2. A Deterministic Control Plane for LLM Coding Agents
  3. A First Look at Coding Agents' Compliance with AI Contribution Rules in Open-Source Communities
  4. When Agents Act Unwatched: The Reduced-Supervision Paradox in Agentic AI
Filed underAgent Governance

More in Agent Governance