Repository navigation
feat: add ncrypted action provider for one-time encrypted secrets - #1567
Open
JustinSeidl wants to merge 1 commit into
Open
JustinSeidl wants to merge 1 commit into
JustinSeidl wants to merge 1 commit into
Conversation
Adds ncryptedActionProvider with create_secret, read_secret and secret_status. Agents can share passwords and API keys as one-time, end-to-end encrypted links instead of putting the values in messages. Encryption is local (AES-256-GCM); the service stores ciphertext only. The first 3 secrets per day are free, then 0.005 USDC on Base via x402, paid from the agent's wallet and capped at maxPaymentUsdc per secret. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
🟡 Heimdall Review Status
|
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Adds
ncryptedActionProvider, which lets an agent share secrets (passwords, API keys, tokens, private notes) as one-time, end-to-end encrypted links instead of putting the value in a chat message, tool output or log.Actions:
create_secret: encrypts the value locally and returns a link that opens exactly once. Optional TTL (5 min to 7 days), passphrase, and email delivery.read_secret: opens a link, returns the value, and destroys the secret.secret_status: tells the creator whether the link has been opened.How it works:
#fragment, so the ncrypted service stores ciphertext only. The first read deletes it atomically.@x402/fetch+registerExactEvmScheme(walletProvider.toSigner())pattern as thex402provider, with aregisterPolicycap (maxPaymentUsdc, default 0.01) so a misbehaving server can never charge more. Reading and status checks are free.crypto.ts). The tests decrypt vectors produced by the reference implementation to pin wire compatibility.supportsNetwork: Base mainnet only, since payments settle in USDC on Base.Disclosure: I'm the author of ncrypted. Source and protocol: https://github.com/Seidl-Family/ncrypted (MIT). It's listed in the x402 Bazaar and the MCP Registry (
io.github.Seidl-Family/ncrypted).Tests
Unit tests (
ncryptedActionProvider.test.ts, 12 tests):create_secret(free path): uploads ciphertext only. The returned link's key decrypts exactly what was uploaded, and the wallet isn't asked to sign.create_secretwithemailTo: opts out of the free tier and emails the link.read_secret, already-read (410) handling,secret_status,supportsNetwork.pnpm exec jest src/action-providers/ncrypted,eslint,prettier --checkandtsc --noEmitall pass.Real mainnet run through AgentKit (direct action invocation rather than the example chatbots, which need OpenAI and CDP keys I didn't use for this):
Separately, while testing I noticed that action invocations trigger analytics requests whose rejections aren't handled (
Error: HTTP error! status: 400as an unhandled rejection), which terminates the process on Node 15+.WalletProvider.trackInitializationalready catches this (#1408), but thesendAnalyticsEvent(...)call inaction-providers/actionDecorator.tshas no.catch. Happy to open a separate PR if useful.Checklist
typescript/agentkit/README.md).changeset/ncrypted-one-time-secrets.md)