Skip to main content

Crate open_agent_profile

Crate open_agent_profile 

Source
Expand description

Native Rust support for Open Agent Profile (OAP) 1.0.

Includes YAML, JSON, and Markdown encodings; schema and security validation; RFC 8785 identities; composition; policy narrowing; prompt rendering; and atomic, retention-aware state delta application.

Structs§

Adjustment
A requested policy value that was narrowed by an effective ceiling.
ApplyOptions
Controls approval, attribution, and time for delta application.
ConflictError
Optimistic-concurrency conflict raised before any mutation is committed.
DeltaApplication
Successful result of applying an agent state delta.
Digests
Canonical identities for a full profile and its immutable specification.
EffectiveTools
Effective tool set and explanations for removed grants.
Issue
One validation issue located by JSON Pointer.
ParseError
OAP loading or parsing failure.
ProfileReference
Pinned reference supplied to a profile composition loader.
RenderOptions
Harness additions and variables used for normative prompt assembly.
ValidationReport
Complete schema, semantic, and security validation result.

Enums§

ApplyError
Failure while validating or applying an agent state delta.
CanonicalError
Failure while producing canonical JSON.
CompositionError
Failure while resolving inherited profiles.
OapFormat
Supported OAP document encoding.
PermissionDecision
Ordered permission decision used for fail-closed narrowing.
RenderError
Failure while substituting variables or rendering a prompt.

Constants§

OAP_VERSION
OAP specification version implemented by this crate.
SUPPORT_VERSION
Version of this Rust support library.

Functions§

apply_delta
Validates and atomically applies state operations to a cloned profile.
canonical_json
Serializes a value using RFC 8785 JSON Canonicalization Scheme rules.
escapes_workspace
Returns whether a relative path lexically escapes its workspace root.
intersect_tools
Intersects harness-granted tools with an OAP profile’s tool policy.
load
Loads an OAP document and infers its encoding from the path.
merge_profile_values
Deep-merges a child profile over a base using OAP composition semantics.
narrow_decision
Returns the more restrictive of a policy ceiling and requested decision.
narrow_permission_map
Applies field-by-field harness ceilings to a requested permission map.
parse
Parses an OAP document with duplicate-key rejection.
profile_digest
Computes the sha256:<hex> identity of the full profile.
profile_digests
Computes both full-profile and specification identities.
render_system_prompt
Builds the normative system prompt and labels profile state as untrusted data.
resolve_composition
Resolves and verifies an extends chain with the supplied profile loader.
serialize
Serializes an OAP document as YAML, JSON, or Markdown.
spec_digest
Computes the sha256:<hex> identity of the profile’s spec member.
substitute_variables
Expands OAP ${{ vars.NAME }} references, failing on missing values.
validate
Runs schema, semantic, and security validation on a parsed OAP document.
validate_path
Loads and validates an OAP document, returning parse failures as issues.
write_atomically
Replaces a file atomically using a temporary file in the same directory.

Type Aliases§

AgentProfile
A parsed AgentProfile document.
AgentStateDelta
A parsed AgentStateDelta document.
Document
A parsed OAP document represented as a JSON-compatible object.