nemoguardrails.manifests.manifest
Versioned, declarative contract describing a rail and how it runs.
A RailManifest combines descriptive RailMetadata with an executable
RailSpec of configuration, flows, actions, and surfaces. Import references
remain declarative until resolve_import_ref explicitly imports their targets.
Descriptive fields are lenient so manifests stay forward-compatible, while the
executable spec is strict so misconfiguration fails loudly at load time.
Module Contents
Classes
Functions
Data
API
Bases: BaseModel
Maps a single surface action parameter to its value source.
Each binding tells the runtime where one argument of a surface’s action comes
from. Prefer the constructor classmethods over building instances directly, as
they set kind and the relevant fields correctly. A resource classifies the
resolved value for runtime validation; use model and model_param when that
value identifies a configured model type.
Bind action_param to a context variable.
Parameters:
Name of the action parameter to populate.
Name of the context variable that supplies the value.
Whether the context variable must be present.
Returns: Binding
A context binding.
Bind action_param to a fixed value baked into the manifest.
Parameters:
Name of the action parameter to populate.
Constant value passed to the action.
Returns: Binding
A literal binding.
Bind an action parameter to a fixed model type.
The returned literal binding sets resource="model", allowing the
runtime to validate a model that is selected by the manifest rather than
the configured flow. For example, Binding.model("model_name", "llama_guard") always supplies model_name="llama_guard".
Parameters:
Name of the action parameter receiving the model type.
Configured model type supplied to the action.
Returns: Binding
A model resource binding with a fixed value.
Bind an action parameter to a configurable model type.
The returned binding reads the model type from a configured surface
parameter and sets resource="model", allowing the runtime to validate
the resolved model before invoking the action. For example,
Binding.model_param("model_name", "model") binds $model=content_safety
to model_name="content_safety".
Parameters:
Name of the action parameter receiving the model type.
Name of the surface parameter that selects the model type.
Whether the surface parameter must be provided.
Returns: Binding
A model resource binding backed by a surface parameter.
Bind action_param to a caller-supplied surface parameter.
Parameters:
Name of the action parameter to populate.
Name of the surface parameter that supplies the value.
Whether the surface parameter must be provided.
Returns: Binding
A surface_param binding.
Bases: ImportTargetRef
Import reference to a rail configuration specification.
Bases: BaseModel
Environment variable declared by a rail requirement.
Bases: BaseModel
Bases: BaseModel
Model resource declared by a rail requirement.
Bases: BaseModel
Import references for the actions declared by a rail.
Bases: BaseModel
Manifest reference to a rail’s typed configuration schema.
Bases: enum.Enum
Pipeline direction in which a rail surface runs.
Bases: BaseModel
Colang flow files and flow names declared by a rail.
Bases: BaseModel
Top-level, versioned manifest for a single rail.
The nested spec holds executable declarations such as the config schema,
flows, actions, surfaces, requirements, and privacy metadata. Those fields
are also exposed as read-only properties for convenient access.
Bases: BaseModel
Descriptive, non-executable facets of a rail used by the catalog.
None of these fields change runtime behavior; they drive display, discovery,
and filtering. categories and capabilities are closed taxonomies (the
pipeline stage a rail runs in and the functional behavior it advertises,
respectively); use the free-form tags for labels that belong to neither.
Unknown keys are preserved rather than rejected (extra="allow") so a
manifest authored against a newer schema still loads on an older install and
authors can attach custom annotations without a schema change.
Bases: BaseModel
Data handling and remote-service behavior declared by a rail.
Bases: BaseModel
Installation and runtime resources declared by a rail.
Bases: BaseModel
Executable configuration, flows, actions, and requirements for a rail.
Bases: BaseModel
Configured flow surface mapped to a declared rail action.
Bases: BaseModel
External service declared by a rail requirement.
Return the import target encoded by a supported manifest reference.
Return every configuration and action import reference in a manifest.
Import and return the Python object referenced by a manifest entry.