Skip to content

The agent that grows with you

docs(plugin-catalog): rule 11 — credentials come through Hermes, never from files

teknium184a244e6d6cd
diff --git a/plugin-catalog/README.md b/plugin-catalog/README.md
index ca23019381c..b17cb01e658 100644
--- a/plugin-catalog/README.md
+++ b/plugin-catalog/README.md
@@ -78,13 +78,19 @@ meaningful:
their CI) — see the developer guide's *Dependency security policy*. A
recent floor alone is not grounds to hold an entry.
-11. **Credentials stay with their owner.** A plugin reads the credentials it is
- configured with: the env vars in `requires_env` and its own `config_schema`
- secrets. Reading another tool's login (a vendor CLI's token file, a browser
- profile) must be disclosed in the PR and is a trust-tier call for a
- maintainer. Refreshing, rotating or writing another client's OAuth tokens, or
- presenting itself as another vendor's client, is not admitted without an
- explicit maintainer ruling; a read-only build is the usual way through.
+11. **Credentials come through Hermes, never from files.** A plugin gets
+ secrets only through Hermes's routes. Its declared `requires_env` and
+ `config_schema` secrets are read with `agent.secret_scope.get_secret(NAME)`,
+ which honours the active profile (a bare `os.environ` read can pick up another
+ profile's key under multiplexing). A subscription sign-in (Codex / ChatGPT
+ today) is used only through `credentialed_provider_request` with
+ `requires_auth`, so Hermes attaches the token and the plugin never holds it. A
+ plugin never reads `.env` files, Hermes's `auth.json`, another tool's login (a
+ vendor CLI's token file, a browser profile, a keychain) or any other
+ credential store directly, and never refreshes, rotates or writes OAuth tokens
+ or presents itself as another vendor's client. If Hermes has no route for a
+ credential a plugin needs, ask for one in a Hermes issue or PR; the plugin
+ does not work around it.
12. **Approvals and unattended runs are respected.** A plugin never routes around
Hermes's approval system: no auto-approving, no disabling guards, and no
spawning Hermes or shell children that inherit YOLO or non-interactive mode
diff --git a/website/docs/developer-guide/memory-provider-plugin.md b/website/docs/developer-guide/memory-provider-plugin.md
index d7f2e1f37ec..e307a615a37 100644
--- a/website/docs/developer-guide/memory-provider-plugin.md
+++ b/website/docs/developer-guide/memory-provider-plugin.md
@@ -90,6 +90,7 @@ Your plugin implements the `MemoryProvider` abstract base class from `agent/memo
```python
from agent.memory_provider import MemoryProvider
+from agent.secret_scope import get_secret
class MyMemoryProvider(MemoryProvider):
@property
@@ -98,7 +99,7 @@ class MyMemoryProvider(MemoryProvider):
def is_available(self) -> bool:
"""Check if this provider can activate. NO network calls."""
- return bool(os.environ.get("MY_API_KEY"))
+ return bool(get_secret("MY_API_KEY"))
def initialize(self, session_id: str, **kwargs) -> None:
"""Called once at agent startup.
@@ -106,7 +107,7 @@ class MyMemoryProvider(MemoryProvider):
kwargs always includes:
hermes_home (str): Active HERMES_HOME path. Use for storage.
"""
- self._api_key = os.environ.get("MY_API_KEY", "")
+ self._api_key = get_secret("MY_API_KEY") or ""
self._session_id = session_id
# ... implement remaining methods
diff --git a/website/docs/developer-guide/plugins/catalog-submission.md b/website/docs/developer-guide/plugins/catalog-submission.md
index f13e29b41a1..5de5d4ec2e2 100644
--- a/website/docs/developer-guide/plugins/catalog-submission.md
+++ b/website/docs/developer-guide/plugins/catalog-submission.md
@@ -136,13 +136,19 @@ the gallery. There is no separate listing to maintain.
their CI) — see the developer guide's *Dependency security policy*. A
recent floor alone is not grounds to hold an entry.
-11. **Credentials stay with their owner.** A plugin reads the credentials it is
- configured with: the env vars in `requires_env` and its own `config_schema`
- secrets. Reading another tool's login (a vendor CLI's token file, a browser
- profile) must be disclosed in the PR and is a trust-tier call for a
- maintainer. Refreshing, rotating or writing another client's OAuth tokens, or
- presenting itself as another vendor's client, is not admitted without an
- explicit maintainer ruling; a read-only build is the usual way through.
+11. **Credentials come through Hermes, never from files.** A plugin gets
+ secrets only through Hermes's routes. Its declared `requires_env` and
+ `config_schema` secrets are read with `agent.secret_scope.get_secret(NAME)`,
+ which honours the active profile (a bare `os.environ` read can pick up another
+ profile's key under multiplexing). A subscription sign-in (Codex / ChatGPT
+ today) is used only through `credentialed_provider_request` with
+ `requires_auth`, so Hermes attaches the token and the plugin never holds it. A
+ plugin never reads `.env` files, Hermes's `auth.json`, another tool's login (a
+ vendor CLI's token file, a browser profile, a keychain) or any other
+ credential store directly, and never refreshes, rotates or writes OAuth tokens
+ or presents itself as another vendor's client. If Hermes has no route for a
+ credential a plugin needs, ask for one in a Hermes issue or PR; the plugin
+ does not work around it.
12. **Approvals and unattended runs are respected.** A plugin never routes around
Hermes's approval system: no auto-approving, no disabling guards, and no
spawning Hermes or shell children that inherit YOLO or non-interactive mode
diff --git a/website/docs/developer-guide/plugins/index.md b/website/docs/developer-guide/plugins/index.md
index 89319fa2fa9..2697ca94e5a 100644
--- a/website/docs/developer-guide/plugins/index.md
+++ b/website/docs/developer-guide/plugins/index.md
@@ -835,7 +835,8 @@ config_schema:
**Secrets never touch `config.yaml`.** A `secret` field carries only the `.env`
name and whether a value is set; the Desktop stores the value through the same
credential route as provider API keys (`PUT /api/env`), and your plugin reads it
-with `os.environ.get("MY_PLUGIN_API_KEY")` — exactly like a `requires_env` entry.
+with `get_secret("MY_PLUGIN_API_KEY")` from `agent.secret_scope` — exactly like a `requires_env` entry.
+Never read `.env`, `auth.json` or another tool's credential files yourself (catalog rule 11).
The `plugins.manage settings` action refuses secret keys and any value whose type
or `choices` disagree with the schema.
@@ -1858,12 +1859,12 @@ class MyPlatformAdapter(BasePlatformAdapter):
async def disconnect(self): ...
def check_requirements():
- import os
- return bool(os.environ.get("MYPLATFORM_TOKEN"))
+ from agent.secret_scope import get_secret
+ return bool(get_secret("MYPLATFORM_TOKEN"))
def _env_enablement():
- import os
- tok = os.getenv("MYPLATFORM_TOKEN", "").strip()
+ from agent.secret_scope import get_secret
+ tok = (get_secret("MYPLATFORM_TOKEN") or "").strip()
if not tok:
return None
return {"token": tok}
@@ -1918,8 +1919,8 @@ class MyMemoryProvider(MemoryProvider):
return "my-memory"
def is_available(self) -> bool:
- import os
- return bool(os.environ.get("MY_MEMORY_API_KEY"))
+ from agent.secret_scope import get_secret
+ return bool(get_secret("MY_MEMORY_API_KEY"))
def initialize(self, session_id: str, **kwargs) -> None:
self._session_id = session_id