Schema Enforcement
A model adds the type or schema structure a Guardrail needs to parse, validate, and, for schema-backed formats, transform a payload. Zilla accepts a model wherever a binding validates part of a request or response, from a Kafka message key to an HTTP request body.
Primitive Models
Primitive models validate a value against a basic type, with a few type-specific properties:
model: string
encoding: utf_8
maxLength: 256Schema Models
Schema-backed models reference a catalog to supply the schema used to validate, and optionally transform, the payload. A schema can be resolved by subject, by topic, or by a specific id:
model: json
catalog:
my_catalog:
- subject: tool-payloadThe Avro and Protobuf models also accept a view, which transforms the payload between the wire format and the schema format. That transform is what Transform covers.
Guardrails in Practice
The http binding accepts a model on request and response content, headers, path, and query parameters, so a Guardrail can reject a malformed tool call or upstream response before it reaches an agent:
options:
requests:
- path: /tools/call
method: POST
content:
model: json
responses:
- status: 200
content:
model: jsonSee the http server and http client reference for the full set of request and response validation options, which currently cover the primitive and schema-backed model names above. Kafka Gateway's Validate shows the same schema-backed model paired with a catalog to validate against a schema pulled from a registry; see Validate for how that pairing applies as a Guardrail.

