> ## Documentation Index
> Fetch the complete documentation index at: https://docs.lyzr.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Compliance

> What makes an agent or runtime OpenGAP-compliant.

This page defines OpenGAP compliance — the requirements an agent or runtime must meet to claim compatibility with the specification.

## Agent compliance

An agent is OpenGAP-compliant if:

### Required

* [ ] Has `agent.yaml` at the repository root (or declared agent root)
* [ ] `agent.yaml` includes `opengap`, `name`, `version`, `model.provider`, and `model.name`
* [ ] The `opengap` field value matches the format `"MAJOR.MINOR"` (e.g., `"0.4"`)
* [ ] All skills in `skills/` export at least one skill-decorated function
* [ ] No undeclared file dependencies outside the agent directory tree
* [ ] All referenced environment variables are documented (in README or `agent.yaml` comments)

### Recommended (not required for compliance)

* [ ] Has a `tests/` directory with at least one test per skill
* [ ] Skills include descriptive `description` fields (not empty strings)
* [ ] `agent.yaml` has a `description` field
* [ ] `.gitignore` excludes `.env`, `*.pyc`, `__pycache__`

### Validation

```bash theme={null}
gitagent validate
```

This command checks all required compliance criteria and reports any violations. An agent that passes `gitagent validate` with no errors is compliant.

***

## Runtime compliance

A runtime is OpenGAP-compliant if it:

### Discovery

* [ ] Reads `agent.yaml` from the agent root to initialize the agent
* [ ] Rejects agents whose `opengap` version it does not support, with a clear error
* [ ] Discovers skills by scanning the `skills.path` directory (default: `skills/`)
* [ ] Loads skills from `.py` files and Python packages in the skills directory
* [ ] Discovers hooks from the `hooks.path` directory (default: `hooks/`)
* [ ] Discovers flows from the `flows.path` directory (default: `flows/`)

### Skill contract

* [ ] Passes skill inputs as keyword arguments matching the function signature
* [ ] Returns skill output as a JSON-serializable value
* [ ] Reports `SkillError` to the LLM as a tool error (not as an exception)
* [ ] Enforces the `input_schema` if provided in the skill decorator

### Execution

* [ ] Respects `execution.max_iterations` — stops the agent loop after N iterations
* [ ] Respects `execution.timeout` — cancels the run after N seconds
* [ ] Injects conversation history (last `memory.max_history` turns) into the context when `memory.enabled: true`

### Environment variable interpolation

* [ ] Resolves `${VAR_NAME}` and `${VAR_NAME:-default}` in `agent.yaml` values
* [ ] Fails with a clear error if a required variable (no default) is not set

### Validation command

* [ ] Implements `validate` (or equivalent) that checks agent compliance and reports violations

### Version negotiation

* [ ] Reports the OpenGAP spec version(s) it supports
* [ ] Refuses to execute an agent targeting an unsupported spec version

***

## Spec version compatibility

| Spec version | GitAgent versions | Key changes                                      |
| ------------ | ----------------- | ------------------------------------------------ |
| `0.4`        | 0.7+              | Added `flows/`, plugin system, `execution` block |
| `0.3`        | 0.5–0.6           | Added `hooks/`, memory providers                 |
| `0.2`        | 0.3–0.4           | Added `agent.yaml` env var interpolation         |
| `0.1`        | 0.1–0.2           | Initial spec                                     |

Runtimes should support at least the current and previous minor version for graceful upgrades.

***

## Requesting compliance certification

If you've built an OpenGAP-compatible runtime and want it listed as officially compliant:

1. Implement all required runtime compliance criteria above
2. Run the [OpenGAP compliance test suite](https://github.com/LyzrCore/opengap/tree/main/compliance-tests) against your runtime
3. All tests must pass
4. Open a PR to the OpenGAP repo adding your runtime to `RUNTIMES.md`

The compliance test suite is a set of reference agents that test each aspect of the spec. A compliant runtime must execute all of them correctly.
