SkillKit.CredentialProvider behaviour (SkillKit v0.1.0)

Copy Markdown View Source

Behaviour for resolving credentials on behalf of tools.

Tools call list/2 to enumerate the credential keys available to an agent, and fetch/3 to resolve a single key to a value. Implementations are responsible for scope-based policy — the agent struct (which carries the scope) is passed to every call.

Configure a provider in application config:

config :skill_kit, credential_provider: MyApp.Credentials

If unset, this module itself is used as a null provider: list/2 returns [] and fetch/3 returns {:ok, nil} for every call. Tools that depend on credentials (currently SkillKit.Tools.Shell) will run with no credentials exposed until a real provider is configured.

Summary

Types

agent()

@type agent() :: SkillKit.Agent.t()

key()

@type key() :: String.t()

Callbacks

fetch(tool, agent, key)

@callback fetch(tool :: module(), agent(), key()) :: {:ok, String.t() | nil} | :error

list(tool, agent)

@callback list(tool :: module(), agent()) :: [key()]