Skip to content

docs: add gating guidance for Action-Identity Signing (CPL-207)#269

Merged
GTC6244 merged 4 commits intonextfrom
feature/cpl-207-docs-about-gating-action-identity-signing
Apr 5, 2026
Merged

docs: add gating guidance for Action-Identity Signing (CPL-207)#269
GTC6244 merged 4 commits intonextfrom
feature/cpl-207-docs-about-gating-action-identity-signing

Conversation

@GTC6244
Copy link
Copy Markdown
Contributor

@GTC6244 GTC6244 commented Apr 4, 2026

Summary

Adds a new "What if Someone Else Runs My Action?" subsection to the Action-Identity Signing section of the patterns doc (docs/lit-actions/patterns.mdx). Addresses the common concern about unauthorized action execution with two answers:

  • For pure, side-effect-free actions (like signing a price feed), it doesn't matter — someone else running the same IPFS CID is just paying for execution on your behalf.
  • For actions that need access control, the doc recommends two layers:
    1. API key scoping via the Dashboard as the primary control (enforced at the gateway before execution)
    2. In-action signature verification as defense-in-depth (verify a cryptographic proof, not a plain parameter)

Includes an explicit <Note> warning against gating on plain js_params values, since parameters are caller-supplied and trivially spoofable.

Pre-Landing Review

Pre-Landing Review: No code issues found (docs-only change).

Adversarial review (Claude + Codex): Both models independently flagged that the original draft's gating example (checking a plain PKP public key from js_params) was bypassable. The example was rewritten to use signature verification (ethers.utils.verifyMessage) and the section now recommends Dashboard API key scoping as the primary access control.

Test plan

  • Docs-only change — no application code modified
  • Adversarial review passed (Claude + Codex converged on fix)

🤖 Generated with Claude Code

Adds "What if Someone Else Runs My Action?" section to the patterns
doc. Covers two answers: (1) for pure actions, it doesn't matter,
and (2) for restricted access, use Dashboard API key scoping as
the primary control with in-action signature verification as
defense-in-depth. Includes a warning against gating on plain
js_params values.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@GTC6244 GTC6244 requested review from a team and Copilot April 4, 2026 02:24
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds guidance to the Lit Actions “Patterns” documentation to address concerns about unauthorized execution of Action-Identity–signed Lit Actions, and recommends practical access-control layers for actions that require restriction.

Changes:

  • Introduces a new “What if Someone Else Runs My Action?” subsection under Action-Identity Signing.
  • Documents when “someone else running the same CID” is harmless for pure/side-effect-free actions.
  • Recommends API-key scoping as the primary control and in-action cryptographic verification as defense-in-depth, with an explicit warning against trusting plain js_params.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +141 to +149
```javascript
async function main({ signature, message }) {
const ALLOWED_ADDRESS = "0xAbc123..."; // your PKP's wallet address

const recovered = ethers.utils.verifyMessage(message, signature);
if (recovered.toLowerCase() !== ALLOWED_ADDRESS.toLowerCase()) {
throw new Error("Unauthorized: caller signature does not match allowed address");
}

Copy link

Copilot AI Apr 4, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The in-action signature check verifies address ownership, but the example uses a caller-supplied message without any freshness / anti-replay property. As written, a previously obtained (or leaked) {message, signature} pair can be replayed indefinitely to pass the gate. Consider documenting that the message should include a nonce and/or expiry (ideally server-generated) and that the action should verify freshness (e.g., via an external API, on-chain state, or other replay protection).

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch. Added a note that the message should include a nonce or timestamp for replay protection, plus an inline comment in the code example. Fixed in ff55dd9.

Comment thread docs/lit-actions/patterns.mdx Outdated
Comment thread docs/lit-actions/patterns.mdx
GTC6244 and others added 2 commits April 3, 2026 22:29
The PKP address check is reliable when the group is configured so
only a specific PKP can be used with the action — the ownership
model enforces that callers can only use PKPs belonging to their
account. Signature verification moves to method #3 as defense-in-depth.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@GTC6244 GTC6244 self-assigned this Apr 4, 2026
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@GTC6244 GTC6244 merged commit b097a44 into next Apr 5, 2026
17 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.

2 participants