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.
- Apply
Options - Controls approval, attribution, and time for delta application.
- Conflict
Error - Optimistic-concurrency conflict raised before any mutation is committed.
- Delta
Application - Successful result of applying an agent state delta.
- Digests
- Canonical identities for a full profile and its immutable specification.
- Effective
Tools - Effective tool set and explanations for removed grants.
- Issue
- One validation issue located by JSON Pointer.
- Parse
Error - OAP loading or parsing failure.
- Profile
Reference - Pinned reference supplied to a profile composition loader.
- Render
Options - Harness additions and variables used for normative prompt assembly.
- Validation
Report - Complete schema, semantic, and security validation result.
Enums§
- Apply
Error - Failure while validating or applying an agent state delta.
- Canonical
Error - Failure while producing canonical JSON.
- Composition
Error - Failure while resolving inherited profiles.
- OapFormat
- Supported OAP document encoding.
- Permission
Decision - Ordered permission decision used for fail-closed narrowing.
- Render
Error - 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
extendschain 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’sspecmember. - 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§
- Agent
Profile - A parsed
AgentProfiledocument. - Agent
State Delta - A parsed
AgentStateDeltadocument. - Document
- A parsed OAP document represented as a JSON-compatible object.