A small, opinionated, human-readable language for describing robot intent.
Validator
Status: alpha, on PyPI as urml-validator. It ships the schemas, the six-pass validator, the urml CLI and JSON Schema export. Versions are 0.x, so a release may break compatibility; the changelog says what each one changed. The LLM bridge and its on-device providers ship separately as urml-llm-bridge.
What this is
The static verification engine for URML. Given a URML program, a Layer-1 capability manifest for the target robot, and the active safety envelope, the validator returns one of two outcomes:
- Accepted. The program is statically valid, and the runtime may execute it.
- Rejected with a structured error. The program fails one or more checks, and the error is a machine-readable object that a calling tool (often the LLM bridge) can use to revise the program.
The validator is the safety boundary. Per MANIFESTO.md §Design Principles and CLAUDE.md §What Claude Should Never Do:
URML programs are executed only after static verification against the target's capability manifest and active safety envelope. Any "fast path" that skips verification is rejected on review.
The validator runs in the same process as the runtime. URMLRuntime.execute imports it and re-validates every program, against the manifest, envelope, policy and rulebooks it is given, before its first adapter call. A rejected program raises ValidationRejectedError and the adapter receives nothing; python -m urml_conformance --goal-line checks this for every rejected conformance fixture. Skipping the check takes an explicit revalidate=False in code.
What the validator checks
The validator runs these checks against every URML program. The specification asks for some checks the validator does not make; they are listed further down, under "What the validator does not check today".
Layer-3 (composition) checks
- The program parses as valid URML against the layer-3 grammar.
- Every composition operator is well-formed (a
parallelhas at least two branches, aretryhas a positivemax_attempts,on_erroris one ofabort_and_report,continue,retry). - Every
$variablereference resolves to a priorstore_as. - Types match across producer/consumer primitives.
Layer-2 (primitive) checks
- Every primitive is one the schema defines. An unknown primitive name is an
argument.*error. - Every primitive's required arguments are present and well-typed.
- Profile gates are honored:
driveandturnneed theeducationalprofile,look_atandgestureneed thesocialprofile.
Layer-1 (capability) checks
- The robot's manifest declares every capability the program needs (mobility, manipulation, perception, declared frames, declared locations).
- Every named place in the program resolves to a declared location or a declared area in the manifest.
Safety-envelope checks
- Declared limits are checked on each step they apply to: velocity, altitude, grip force, the declared mass of an object a
move_tocarries, drop height, geofences with their altitude bands, people-occupancy zones, and the link-loss policy. For a numeric limit, the strictest of the manifest value and the envelope value applies. - Spatial checks run on every place a step names (a pose, a declared location or area, a docking station, a scan area), whatever the profile. A geofence is an allowlist and a people-occupancy zone is a denylist.
- The checks judge the targets a program names. The runtime chooses the path between two targets, and the validator does not see it.
Rulebook checks (RFC-0702, Draft)
- A rulebook states what law or a company allows: caps, forbidden primitives, forbidden zones, no flight over declared people zones, required deployment declarations, and how many aircraft fly at once. The format is
spec/layer-1-hal/rulebook.md. - The rulebook pass runs after the envelope checks and cites the rule it enforces, with
rule.*codes.--no-policydoes not skip it. - The bundled rulebook, the statically checkable subset of 14 CFR Part 107 and Part 89, applies by default to drone programs and aircraft.
--rulebook PATHadds organization and deployment rulebooks;--no-default-rulebooksswitches the bundled one off, with a warning. - A deployment rulebook records declarations (such as the Remote ID method) and exceptions that name their basis (such as a waiver number). An exception turns a violation into a warning that names the basis. URML records these and does not verify them.
- Every report lists the rules a static check cannot see as obligations. A program that passes a rulebook is not a legal compliance determination.
urml validate flight.urml.yaml -m drone.manifest.yaml \
--rulebook examples/rulebooks/example-deployment.yaml
What the validator does NOT do
- It does not execute the program. That is the runtime's job.
- It does not parse natural language. That is the LLM bridge's job.
- It does not generate the URML program. That is an LLM's job, via the LLM bridge.
- It does not monitor runtime state. Run-time safety (an unexpected obstacle, a sudden wind gust, a person walking into the cell) is the substrate's job. The validator is static; the substrate is dynamic. Both are required for safety.
Language
- Python, primary implementation.
mypy --strict. Public API fully type-annotated. - A long-running validator service (e.g., as a sidecar to multiple runtimes in production) may eventually be backed by Rust for deployment ergonomics; the Python implementation remains the reference.
API
from pathlib import Path
import yaml
from urml_validator import ValidationResult, validate
def load(name: str) -> dict:
return yaml.safe_load(Path(name).read_text(encoding="utf-8"))
program = load("program.urml.yaml") # parsed YAML; validate() does not take a YAML string
manifest = load("manifest.yaml")
envelope = load("envelope.yaml")
result: ValidationResult = validate(
program, # dict or URMLProgram
manifest, # dict or CapabilityManifest
envelope, # dict, SafetyEnvelope, or None
profiles=("home",), # the active profiles
policy="DEFAULT", # the bundled US-federal policy; None skips the policy pass
rulebooks=(), # organization and deployment rulebooks, parsed YAML
)
if result.accepted:
print("accepted") # hand the program to a runtime; URMLRuntime validates again before it acts
else:
# result.errors is a list of structured errors,
# designed to be readable by an LLM and used for revision.
for err in result.errors:
print(err.render())
The three file names are the ones urml init writes. validate_fleet does the same for a multi-robot program and a fleet roster.
License
The validator is licensed under the Business Source License 1.1: free for non-production use, commercial license for production (see LICENSING.md). Research, education and evaluation use is free, so anyone can check a URML program against a manifest without a contract.
Quickstart
From PyPI:
python -m venv .venv && . .venv/bin/activate # Windows: .venv\Scripts\activate
pip install urml-validator
urml --version
To run the tests, work from the root of a checkout. The suite also runs examples from the repository, and those import sibling packages, so install them alongside:
python -m venv .venv && . .venv/bin/activate # Windows: .venv\Scripts\activate
pip install -e "reference/validator[dev]" -e reference/llm-bridge -e reference/ros2-runtime \
-e reference/px4-runtime -e reference/ardupilot-runtime -e reference/opcua-runtime \
-e reference/isaac-runtime -e conformance
cd reference/validator && pytest
The tests cover the schemas (the red-mug example parses; every primitive accepts its minimal valid form; cross-field rules fire, e.g. move_to requires exactly one of location/pose, capture(media: video) requires duration, release(mode: place) requires at), each validator pass, the policy and rulebook engines, the CLI and the evidence report.
What works today:
-
Pydantic v2 schemas for Layer-1 (capability manifest), Layer-2 (the 12 core primitives of RFC-0002 and the profile primitives added since), Layer-3 (composition, including the fleet nodes
onandbarrier), the safety envelope, the compliance policy, the rulebook, the fleet roster and the top-levelURMLProgram. -
The Step / BehaviorOrStep tagged union accepts the YAML surface (
{move_to: {...}}) and the recursive composition forms. -
The six-pass validator.
urml_validator.validate(program, manifest, envelope, profiles)runs the argument, capability, envelope, rulebook, binding and compliance-policy passes in that order and returns aValidationResultwith structuredValidationErrors. Error codes are stable and namespaced (argument.*,capability.*,envelope.*,rule.*,binding.*,policy.*, andfleet.*fromvalidate_fleet); the LLM bridge feeds them back to the model when it asks for a revision. -
Example:
from urml_validator import validate result = validate(program, manifest, envelope, profiles=("home",)) if result.accepted: runtime.execute(program) else: for err in result.errors: print(err.render())
urml CLI
Installing the package puts the urml console script on PATH. This example names files in the repository, so run it from the repository root:
urml validate examples/home/red-mug.urml.yaml \
--manifest reference/validator/tests/fixtures/manifests/turtlebot4_home.yaml \
--envelope reference/validator/tests/fixtures/envelopes/home_default.yaml \
--profile home
Exit codes: 0 accepted, 1 validation failed, 2 usage error (missing file, bad YAML), 64 internal error.
Add --json to emit the raw ValidationResult for machine consumers (LLM bridge revision flow, CI checks).
Add --evidence-log PATH (on validate, execute, translate and run) to append one validation record per verdict to a local JSON Lines file. It is off by default and changes nothing the command prints. See docs/evidence/validation-records.md.
urml --help lists the other subcommands: init, execute, translate, run, bench, emit-prompt, schema, conformance run and evidence. Some need a sibling package and say so when it is missing: urml-llm-bridge for translate, run, bench and emit-prompt, urml-ros2-runtime for execute and run, urml-conformance for conformance run.
JSON Schema export
# Print one schema to stdout (suitable for piping into an LLM prompt fixture).
urml schema --name program
# Write every schema to a directory.
urml schema --all --out-dir build/schemas/
Produces Draft 2020-12 schemas for the program, the capability manifest, the safety envelope, the compliance policy, the fleet roster and the rulebook (--name takes program, manifest, envelope, policy, roster or rulebook). The LLM bridge consumes the program schema as the structured-output contract; robot makers consume the manifest schema when writing manifests by hand.
The Python API mirrors the CLI:
from urml_validator import export_schema, write_schemas
schema = export_schema("program") # dict
write_schemas(Path("build/schemas/")) # writes one urml-<name>.schema.json per schema
What the validator does not check today:
- Definite assignment across
branch,parallelandretry. A$variablecounts as bound when its name is bound anywhere earlier in the program, even inside a branch that may not run. - Field types inside a binding.
$ref.fieldis accepted whenever the bound value is a structured payload; the field itself is not checked. - Some profile rules the specification states. The drone profile makes an altitude mandatory on
move_toand prohibitswaitin flight, and the validator accepts both. - Envelope limits that exist only at run time, such as weather, or that no manifest or envelope field carries.
docs/safety/envelope-coverage.mdlists, for each primitive, what is enforced and what is not.
Related documents
/spec/layer-1-hal/: manifest schema./spec/layer-2-primitives/: primitive contracts./spec/layer-3-behavior/: composition grammar./reference/llm-bridge/: the primary consumer of structured validation errors./conformance/: uses the validator as part of its end-to-end tests.
Metadata
Release files for urml-validator 0.5.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| urml_validator-0.5.4.tar.gz | 487.3 kB | Without provenance | Details for urml_validator-0.5.4.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| urml_validator-0.5.4-py3-none-any.whl | Python 3 | none | any | Details for urml_validator-0.5.4-py3-none-any.whl |
Total release size: 729.9 kB
Release files / urml_validator-0.5.4.tar.gz
| Download URL | urml_validator-0.5.4.tar.gz |
|---|---|
| Size | 487.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
69a9b57a22b3437f93c79ddba8f3bd86cf1f53b253ed05edd166e3044ee0f3d4
|
|
BLAKE2b-256 checksum How to use checksums |
29193166ad8eaa215556b0c4b65eb283931c4ecf9c021038e10e820169e95ba8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.16
|
Release files / urml_validator-0.5.4-py3-none-any.whl
| Download URL | urml_validator-0.5.4-py3-none-any.whl |
|---|---|
| Size | 242.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f8090bc41a934126afaa4ad54bd2adbdb42486d9002034d474f292e6a3df115d
|
|
BLAKE2b-256 checksum How to use checksums |
d0ed9b8e0e7ceef366f464e017f7882398cfce2aa63678af9053c1a659bd95bf
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.16
|
Security for urml-validator 0.5.4
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.