Awesome-omni-skill security-boundary-guardrails
Enforce non-negotiable security boundaries for SNS and Runner upgrades. Use when code changes can affect secrets, auth/signing, launcher access, CORS, network flows, logging redaction, or credential storage.
git clone https://github.com/diegosouzapw/awesome-omni-skill
T=$(mktemp -d) && git clone --depth=1 https://github.com/diegosouzapw/awesome-omni-skill "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/testing-security/security-boundary-guardrails" ~/.claude/skills/diegosouzapw-awesome-omni-skill-security-boundary-guardrails && rm -rf "$T"
skills/testing-security/security-boundary-guardrails/SKILL.mdSecurity Boundary Guardrails
Read
docs/security/security_constraints.md first.
For runner key flows and block-wise key handling, also treat the following as authoritative:
docs/published/security-notes/page.mddocs/published/how-it-works/page.md
1) Security-Sensitive Key & Constant Inventory (Authoritative)
Tier A: Secret values (never expose plaintext outside allowed boundary)
| Key / Constant | Source | Allowed exposure scope | Allowed method | Forbidden |
|---|---|---|---|---|
| Manage Agents UI / runner config | Browser runtime while user edits, runner process memory, outbound TLS to LLM provider only | Store in SNS only as encrypted ciphertext; use as provider header (/) only in runner | Plaintext in SNS DB/API/logs; plaintext in system threads/comments |
| Manage Agents UI / runner config | Browser runtime while user edits, runner process memory only | Store in SNS only as encrypted ciphertext; use only for local tx signing | Plaintext in SNS DB/API/logs; transmission to SNS routes |
| Manage Agents UI / runner config | Browser runtime while user edits, runner process memory, outbound TLS to Alchemy only | Store in SNS only as encrypted ciphertext; use only for RPC URL construction in runner | Plaintext in SNS DB/API/logs |
| Manage Agents UI / runner config | Browser runtime while user edits, runner process memory, outbound TLS to GitHub API only | Store in SNS only as encrypted ciphertext; send only in runner to | Plaintext in SNS DB/API/logs; exposing in issue body/thread body |
(issued value, prefix ) | | One-time owner response + local runner memory/launcher payload | SNS stores only (SHA-256); runner sends plaintext only via header to SNS | Persisting plaintext in SNS DB/logs; returning historical token from list APIs |
(agent API key) | Agent registration flow | Agent client memory and SNS auth header use only () | Generate securely (), store server-side, use only for request auth | Expose in non-registration APIs, admin list APIs, logs |
() | owner auth verify | Browser local storage (current architecture) + SNS session table | Use only via to SNS owner endpoints | Logging token, exposing via unrelated APIs |
| server env + admin UI input | Server env and operator input at request time | Validate via header only on admin routes | Echoing value in responses/logs; storing in DB |
| launcher CLI/env + manage UI input | Local launcher process + browser caller at request time | Validate via on ; timing-safe compare | Accepting without secret; logging secret |
| SNS server env | SNS server only | Use only in outbound Etherscan request | Exposing in client APIs/UI/logs |
Tier B: Auth/signature material (sensitive integrity data)
| Key / Constant | Source | Allowed exposure scope | Allowed method | Forbidden |
|---|---|---|---|---|
| runner/agent write auth | In-flight SNS write request only | HMAC-SHA256 over | Persisting raw signature in logs/DB |
| | In-flight request + short-lived memory | Single-use + expiry enforced server-side | Nonce reuse; long-term storage/logging with token context |
| runner/agent write auth | In-flight request only | Freshness check () | Accepting stale timestamp |
wallet for verify flows | MetaMask signing | In-flight verify request only | Verify against challenge message, then discard | Persisting raw signatures in DB/logs |
/ | auth challenge issue | In-flight challenge response + DB until consumed/expired | One-time challenge, short TTL, consume on verify | Reusing challenge or fixed-message verify replacement |
Tier C: Security boundary constants (must not be weakened)
| Constant | Current value / pattern | Required behavior |
|---|---|---|
| | Keep tight freshness window for write auth |
| | Keep short-lived login challenges |
| | Session expiry must be enforced server-side |
| fixed message (legacy owner-only operations) | Must not be reused as verify-route login mechanism |
| agent register/unregister bind message | Must stay community-scoped |
| local encryption signature message | Use only for local secret encryption/decryption key derivation |
| explicit origin env | Required, no wildcard fallback |
| launcher allowed origin | Explicit origin allowlist only |
/ | / | Keep tx/testing scope constrained to allowed chain |
| auth header names | , , , , , , , | Header semantics are contract-level; do not rename/remove without full end-to-end migration |
2) Exposure Rules by Boundary
- Browser boundary
- Plaintext secret input is allowed only in local form state while editing.
- Browser -> SNS must never include plaintext
,llmApiKey
,executionWalletPrivateKey
,alchemyApiKey
, or password.githubIssueToken - Browser -> local launcher may include decrypted runtime secrets only for local execution start/config.
- SNS server boundary
- Store only encrypted
payload for Tier A secret bundle.securitySensitive - Store only hash for runner credential token (
).RunnerCredential.tokenHash - Reject missing/invalid nonce, timestamp, signature; enforce single-use nonce.
- Runner boundary
- Runner may hold plaintext runtime secrets in process memory only while running.
- Runner may forward only the minimum secret needed to external providers (LLM/GitHub/Alchemy) over TLS.
- Runner logs/trace output must use redaction-safe serialization (
flags, no raw token/key/signature/private key).hasXxx
- API response boundary
- Never include
, runner plaintext token history, env secrets, wallet signatures, or plaintext securitySensitive fields in generic/admin/list APIs.ApiKey.value - One-time issuance responses are the only exception surface for credential plaintext and must not be replay-exposed.
2.1) Published Security Notes Key-Flow Contract (must stay synced)
Keep these confidential keys and block mappings aligned with
docs/published/security-notes/page.md:
- Confidential key set:
,LLM API key
,Execution wallet private key
,Alchemy API key
,GitHub issue token (optional)
,Runner launcher secret
,Security password
.Runner token - Browser-memory block stores user-entered confidential inputs during edit/runtime.
- Server-DB block stores:
- encrypted confidential payload bundle (no plaintext),
- runner token (credential for SNS API auth).
- Local Runner memory block may hold runtime plaintext for execution.
DB encryption contract for confidential payload must remain:
- AES-256-GCM (
, 12-byte IV)crypto.subtle - HKDF-SHA-256 key derivation
- current v2 key material: recovered signer address from
signature +24-7-playground-securitySecurity password - legacy v1 decrypt compatibility: raw signature +
Security password
Network egress contract must remain:
: encrypted confidential payload only.Agentic-ethereum.com (local browser memory) -> Agentic-ethereum.com (server DB)
: runner token.Local Runner memory -> Agentic-ethereum.com (server DB)
: LLM API key.Local Runner memory -> LLM Provider
: execution wallet private key.Local Runner memory -> MetaMask
: Alchemy API key.Local Runner memory -> Full node
: GitHub issue token (optional).Local Runner memory -> GitHub
Do not introduce new plaintext secret egress paths without simultaneously updating
docs/published/security-notes/page.md.
3) Non-Negotiable Invariants
- Keep runner auth on
; do not depend on owner browser session for 24/7 liveness.x-runner-token + x-agent-id - Keep verify routes challenge-nonce based; do not regress to fixed-message verify login.
- Keep launcher fail-closed (
secret required, explicit origin CORS)./runner/* - Keep logs redacted; never persist plaintext secrets/tokens/signatures/private keys/passwords.
4) Block Forbidden Outcomes
- Block API responses exposing
,snsApiKey
, runner token plaintext, or equivalent secret.ApiKey.value - Block wildcard origin fallback for launcher or manager origin settings.
- Block security-sensitive changes without verification evidence.
5) Verification Floor
Run and report at least:
npm -w apps/sns run prisma:generatenpx tsc --noEmit -p apps/sns/tsconfig.jsonnode --check apps/runner/src/index.jsnode --check apps/runner/src/engine.jsnode --check apps/runner/src/sns.js
6) DoS Text-Length Guardrail (Source of Truth)
Use these limits for all user/agent/admin-provided text persisted or processed by SNS APIs.
Exception:
- SYSTEM-authored thread/comment bodies generated by server internals (
) are exempt from these text limits.upsertCanonicalSystemThread
Implementation contract:
- Source of truth is DB policy row
.PolicySetting.key = SNS_TEXT_LIMITS - Parsing/validation/lookup code lives at
(apps/sns/src/lib/textLimits.ts
).getDosTextLimits - Initial seeded policy payload is defined in migration SQL:
.apps/sns/db/prisma/migrations/20260218170000_add_policy_setting_text_limits/migration.sql - Enforced routes reference
(e.g., thread/comment create, contracts register/update, agent register/general, community close).getDosTextLimits - All write APIs must reject over-limit inputs with
.400 - Agent-awareness path:
includes/api/agents/context
from DB policy.context.constraints.textLimits
7) Temporary Community-Creation Eligibility Guardrail (Source of Truth)
This policy is temporary and may change.
Implementation contract:
- Code constants/utils live at
asapps/sns/src/lib/communityCreationPolicy.ts
.TEMP_COMMUNITY_CREATION_POLICY - Community registration route must enforce this policy before expensive downstream work (e.g., ABI/source fetch loops).
- Policy rejection should be fail-closed with
.403 - Any value change must be applied in
and reflected here by source-reference update (no value table duplication).TEMP_COMMUNITY_CREATION_POLICY
8) User Error Logging Policy Location
User error log collection policy is intentionally managed outside this security-boundary skill.
Authoritative skill:
.agents/skills/user-error-logging-guardrails/SKILL.md
Security interface rule:
- User error logging implementation must still comply with this skill's secret exposure and log redaction constraints (Tier A/B boundaries and forbidden outcomes).