OpenAgentID documentation
Source referencesRust module referenceopenagent-sdk

openagent-sdk · skills

Declared module signatures, types, configuration, and source documentation.

Source: openagent-sdk/sdks/rust/src/skills.rs. SHA-256: 917d41de8f0984c4dfa386f7d56e170f11d91aedd10a4d8e91e2d8e6208cbf51.

This source reference follows declared modules and preserves feature attributes. It includes public declarations and implementation methods in those modules. Private-module exports and trait resolution still require the compiler; not every declaration is a crate-root import. Function bodies and constant values are omitted. Source comments describe their implementation context and are not a production deployment claim.

skills::SkillsPolicy

Trait every skill policy must implement.

A policy answers a single question: "is this agent allowed to invoke the named skill, given the current verified context?". Implementations may be pure (an in-memory allow-list) or remote (an HTTP call to a policy service); the SDK does not care.

pub trait SkillsPolicy: Send + Sync {
    /// Return `Ok(())` if the skill is allowed, `Err` otherwise.
    fn can_invoke(&self, skill: &str) -> Result<()>;

    /// Return the set of skills currently allowed by this policy.
    ///
    /// Used by tooling and tests; the policy may return an empty set if it
    /// does not enumerate skills (e.g., a remote service).
    fn allowed_skills(&self) -> BTreeSet<String>;
}

Source line: 25.

skills::AllowListPolicy

Default in-memory allow-list skill policy.

AllowListPolicy lets callers register skill names up front and allow them by exact match. Useful for tests, CLI tools, and bootstrap before the real openagent-skills-policy crate is wired in.

#[derive(Debug, Clone, Default)]
pub struct AllowListPolicy {

}

Source line: 42.

skills::AllowListPolicy::new

Create an empty policy that denies every skill.

pub fn new() -> Self;

Source line: 48.

skills::AllowListPolicy::with_skills

Build a policy from an iterator of skill names.

pub fn with_skills<I, S>(skills: I) -> Self
    where
        I: IntoIterator<Item = S>,
        S: Into<String>,;

Source line: 53.

skills::AllowListPolicy::allow

Mutably add a skill to the allow-list.

pub fn allow(&mut self, skill: impl Into<String>);

Source line: 64.

skills::SkillsPolicyHandle

Cheap-to-clone facade returned by [crate::OpenAgent::skills_policy].

Wraps an Arc<dyn SkillsPolicy> so the same policy object can be shared across multiple agent handles without lifetime headaches.

#[derive(Clone)]
pub struct SkillsPolicyHandle {

}

Source line: 91.

skills::SkillsPolicyHandle::new

Wrap any [SkillsPolicy] implementation.

pub fn new<P: SkillsPolicy + 'static>(policy: P) -> Self;

Source line: 97.

skills::SkillsPolicyHandle::from_arc

Wrap an already-Arc'd policy (useful when sharing one policy across many OpenAgent instances).

pub fn from_arc(policy: Arc<dyn SkillsPolicy>) -> Self;

Source line: 105.

skills::SkillsPolicyHandle::can_invoke

Return Ok(()) if the named skill may be invoked, otherwise an error.

pub fn can_invoke(&self, skill: &str) -> Result<()>;

Source line: 110.

skills::SkillsPolicyHandle::allowed_skills

All skills currently allowed by the wrapped policy.

pub fn allowed_skills(&self) -> BTreeSet<String>;

Source line: 115.

On this page