Skip to content

docs: explain that API keys are project-wide secrets - #92

Merged
okdistribute merged 3 commits into
mainfrom
rae/api-key-security-caveats
Aug 11, 2026
Merged

docs: explain that API keys are project-wide secrets#92
okdistribute merged 3 commits into
mainfrom
rae/api-key-security-caveats

Conversation

@okdistribute

Copy link
Copy Markdown
Contributor

Why

The API keys page said only "In production, load the key from a config file or environment variable instead of hardcoding it." That doesn't tell anyone what the actual risk is, and it leaves the most common real question unanswered. From a user:

I don't really get how i can use iroh-services in my user apps. Since every connection needs the service api key, i can't really put this on the users device as this would be insecure, right?

Two things going on there: a correct instinct about the key, and a misconception that connections need one at all.

What changed

iroh-services/access.mdx — two new sections:

  • An API key is a project-wide secret. Long-lived, unscoped, bearer. Extractable from anything it ships in, works from anywhere once out, and rotating it breaks every installed copy of the app. A note covers why the relay token minting doesn't rescue this — the token is short-lived and endpoint-scoped, but it's minted locally from the key, so the key still has to be on the machine.
  • What to do instead. The key lives on endpoints you operate, where the test is whether you control who can read the machine and whether you can rotate without a release — that includes MDM-managed fleets, where the key arrives as a managed configuration and can be revoked from the console, so enterprise deployments get the full feature set. Per-user authorization is a layer you add with endpoint hooks.

What's next now names the per-endpoint access feature (backend authenticates a user, hands their endpoint a scoped credential, key never reaches the device) and says plainly that it is not implemented yet and that layer is currently yours to build.

about/faq.mdx — new entry answering the user's question, leading with the correction that iroh connections never require an API key; only metrics, net diagnostics, and authenticated dedicated relays do.

Note

No code examples for the app-server pattern — there's nothing to point at until the feature exists, and inventing one would imply support that isn't there.

🤖 Generated with Claude Code

https://claude.ai/code/session_01NQRfUmiEunzASEtgGhJ872

okdistribute and others added 3 commits August 11, 2026 15:48
The API keys page said only "load the key from a config file or environment
variable instead of hardcoding it", which doesn't tell people what the actual
risk is or what to do when their app ships to devices they don't control.

Spell out that an API key is a long-lived, unscoped, project-wide bearer
secret, that it's extractable from any binary it ships in, and that the
relay token minting doesn't help because the token is minted locally from
the key. Then cover where the key does belong: endpoints you operate,
including MDM-managed fleets where it arrives as a managed configuration
and can be revoked centrally. Per-user authorization is a layer you add with
endpoint hooks.

Note that per-endpoint access issued through your own application server is
in progress and explicitly not implemented yet.

Adds an FAQ entry for this, taken from a real user question.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NQRfUmiEunzASEtgGhJ872
@okdistribute
okdistribute merged commit b0d627a into main Aug 11, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant