skill.keystore

Page actions AI-ready formats and sharing
Open LLM text
Share with AI
Ask Claude Ask ChatGPT Ask Gemini Ask Copilot

Env-var keystore + presence-onlykey-statustool for Orrery hosts.

Operator keys are declared by name on skill manifests (provider_keys). Values live in the process environment and are resolved by name…

Env-var keystore + presence-onlykey-statustool for Orrery hosts.

Operator keys are declared by name on skill manifests (provider_keys). Values live in the process environment and are resolved by name for server-side skill handlers. Agents see only a presence report — never secret values — via the host-levelkey-statusMCP tool.

BYO-key-per-invocation is explicitly out of scope (sibling Not-now).

skill.keystore

Name Type Default Description
type
qualified_name
element_type
description
source_file
line_number
is_autodoc
autodoc_element
_autodoc_template
_autodoc_url_path
_autodoc_page_type
title
doc_content_hash

Symbols on this page

SecretLeakError
class

Raised when a secret value would be exposed in agent-visible output.

KeyStatus
class

Presence-only report for one provider key name.

Never carries the secret value — only whether the env var is set and non-empty.

EnvKeystore
class

Resolve provider keys from environment variables by name.

Pass a mapping for tests; omit to readenvironlive at each call (operator can set keys without restarting in some deployments).

Server-side handlers may callresolve() / get(). Agent-facing surfaces must usestatus() / status_document() only.

assert_no_secret_leak
function
def assert_no_secret_leak(document: Any, *, secrets: Iterable[str]) -> None

Fail loud if any non-empty secret value appears indocument.

Serializesdocumentto canonical JSON and scans for each secret as a contiguous substring. Empty secrets are skipped. Used by the key-statustool before returning, and available to hosts that assemble other agent-visible payloads from keystore-backed data.

Parameters

Name Type Default Description
document Any
secrets Iterable[str]
register_key_status_tool
function
def register_key_status_tool(app: App, keystore: EnvKeystore, *, names: Iterable[str], tool_name: str = KEY_STATUS_TOOL) -> str

Register the host-levelkey-statusMCP tool (presence only).

The tool returnsstatus_document() for the declared key names and runsassert_no_secret_leak() before returning so resolved secret values never enter the MCP response (or Envelope path — this is a plainapp.tool, not a skill Envelope wrapper).

Returns the registered tool name.

Parameters

Name Type Default Description
app App
keystore EnvKeystore
names Iterable[str]
tool_name str KEY_STATUS_TOOL

View source · /home/runner/work/chirp/chirp/site/../src/chirp/skill/keystore.py:1