agentleFS
fusebase-devfusebase-dev/fusebase-flow/.agents/skills/security-permissions-review/SKILL.md

security-permissions-review

Skill9 starsChanged 28 days agoMITView on GitHub

Use when changes touch auth, permissions, secrets, env files, deploy config, external messages, data export/import, production DB writes, or customer-visible behavior; surfaces sensitive-path findings + approval-required list. Do NOT use as general code review.

  • Reads credentials

The file

We split this skill into the rules it gives an agent

6 rules. About 0 are common, 5 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈5

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  • could be automatic: a setting could enforce it
  1. Distinctive:

    Run secret-pattern check against added lines: API keys, session cookies, private keys, OAuth tokens, cloud credentials.

    line 59
  2. Distinctive:

    Do NOT print secret values, ever (FR-12 + secret-patterns)

    line 116
  3. Distinctive:

    Do NOT silently approve missing approval artifacts ("operator probably has it")

    line 117
  4. Distinctive:

    Do NOT downgrade blockers to non-blockers under deploy pressure

    line 118
  5. Distinctive:

    Do NOT scan beyond the ticket's diff in v0.1 (full repo audits are out of scope)

    line 119
  6. Very specific:

    Do NOT bypass permission_request hook — if it's wired, it's part of the contract

    line 120

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Security & Permissions Review

Purpose

Targeted review for changes that touch security-sensitive surfaces. Distinct from general code-review because the failure modes (credential leak, auth bypass, customer data exposure) have different response thresholds — even non-blocking findings here may require approval gates.

When to invoke

  • Diff touches: auth middleware, permission checks, role/scope code, login/logout flows
  • Diff touches: .env, secrets handling, credential storage, encryption code
  • Diff adds: outbound external messages (email, SMS, webhooks, public posts), customer-facing notifications
  • Diff adds: data export, bulk import, customer data movement
  • Diff adds: production DB writes outside the established repository pattern
  • Diff modifies: deploy config, CI/CD pipeline, infra-as-code
  • Operator says "security review" / "is this safe re: auth?" / "check for secret leaks"

Do not invoke when

  • Diff is purely UI/styling/copy with no auth/data surface
  • Diff is in-test-only changes
  • Diff is a documentation-only commit
  • A higher-priority skill is mid-flight and the operator wants this as a follow-up — file a backlog ticket

Required inputs

InputWhere it livesIf missing
Diffgit diff <baseline>..HEADStop; ask which diff to review
Sensitive paths configpolicies/protected-paths.yml (auth + secrets sections)Use built-in defaults from policy template; flag policy as needing customization
Secret patternspolicies/secret-patterns.ymlUse built-in defaults; flag policy as needing customization
Approval policypolicies/approval-policy.yml (+ optional .local.yml override)Stop; FR-12 cannot enforce without policy
CLI edition map, for Fusebase Apps workdocs/fusebase-cli-edition.mdContinue with generic security review, but mark app-domain auth/secret assumptions unknown
App access + permission grants (Fusebase Apps diffs)deploy handoff / fusebase app list / registration step in ticketAsk operator for current grants; never assume the app is org-only — an inherited visitor principal changes every finding's severity

Procedure

  1. Scan diff for files matching auth/secrets/data patterns from policies/protected-paths.yml.
  2. For Fusebase Apps diffs, load relevant CLI provider skills (app-secrets, handling-authentication-errors, fusebase-gate, fusebase-dashboards) as runtime-specific security context.
  3. Run secret-pattern check against added lines: API keys, session cookies, private keys, OAuth tokens, cloud credentials. NEVER print detected values; redact in any output.
  4. Auth surface: if endpoints added/modified, verify each has explicit auth gate matching project's auth model from AGENTS.md. Flag missing gates as blocker.
  5. Permission surface: if role checks added/modified, verify scope is least-privilege; flag overly broad scopes.
  6. Fusebase-native permission surfaces (Fusebase Apps diffs; skip for non-app repos — the CLI provider skills from step 2 give runtime context):
    • App access principals (public-access flag). fusebase app create/update --access: visitor = any unauthenticated user; --access="" = ALL org roles (NOT lockdown). --access REPLACES the entire principal list — principals are type or type:id — visitor, or orgRole:<id> with ids guest, client, member, manager, owner — verify the change neither silently widens (adds visitor, or adds more org roles than the feature needs; the widest grants are all-org-roles or a visitor principal) nor drops a restriction the operator relies on. Any widening → approval-required list; verify every surface the app exposes (dashboard views, backend endpoints, gate stores) is safe for the widest principal granted.
    • Dashboard permission scopes. --permissions="dashboardView.<dashboardId>:<viewId>.<privileges>": least-privilege — write only on views the runtime actually mutates (batchPutDashboardData / addRelationRows); read-only SDK usage (getDashboardViewData) gets read. Flag write-everywhere grants and grants with no matching SDK call in runtime code.
    • Gate token scopes. Apps using @fusebase/fusebase-gate-sdk: fusebase app update --sync-gate-permissions must run after Gate-SDK call changes — Gate soft mode silently DEGRADES tokens to the allowed subset, so unsynced grants surface as 403s / missing data in smoke, not as deploy failures. Flag any user-facing flow that falls back to service-token auth on Gate 401/403 (blocker per fusebase-gate security rule — service tokens live only in explicit system/admin endpoints with audit logging).
    • SDK / gate-store writes. Isolated SQL/NoSQL store access (isolated_store.* permissions from fusebase env create): verify writes are org/tenant-scoped and requested store permissions match the operations the runtime performs — no broader store grant than the feature needs.
    • Data export/import. Bulk dashboard reads (getDashboardViewData fan-out, CSV/JSON dumps) or bulk imports: (a) export scope = minimum views/columns needed; (b) enumerate the PII fields crossing the boundary (names, emails, phones, client identifiers) in the review summary; (c) tenant isolation — exported/imported rows respect the org/workspace boundary, and import paths validate ownership before write. approval-policy.yml defines no data-export key — flag bulk export/import in the review summary as requiring explicit operator go-ahead before deploy; map to real approval keys only where the same diff genuinely triggers one (auth_or_permission_change, database_migration, secret_file_write).
  7. Production data surface: if DB writes added, verify they go through the established repository/transaction pattern; flag direct connection-string writes.
  8. External-message surface: if outbound messages added (email, SMS, webhooks), verify they're idempotent or have a "do not send twice" safeguard. Flag missing approval artifact for external_customer_visible_message per approval-policy.yml.
  9. Build approval-required list: every operation in diff that triggers require_approval in approval-policy.yml and lacks an acceptable artifact in state/approvals/. "Acceptable" is no longer "a file exists" (v4.7.0+): review the artifact's state, not its presence — run bash hooks/local/approve-local.sh --inventory and read the verdict(strict) column. hooks/shared/approval_artifact.py is the single judge; an artifact can be present and still authorize nothing.
VerdictMeansReview response
VALIDschema, parsed UTC expiry, body/filename action agreement, and any command_digest/repo_id binding all holdsatisfied
MISSING_EXPIRYlegacy artifact, no expires_ataccepted this release and audit-logged (K7); flag for reissue — it is REJECTED once strict_approvals flips
EXPIRED / MALFORMED / ACTION_MISMATCH / BINDING_MISMATCHstale / unparseable / approves a different action / bound to a different command or reponot satisfied — treat as missing

Never assert operator authorship. approved_by and ticket are audit metadata, not authenticated authority (decision K3) — the agent and the operator write as the same OS principal. A review finding of the form "approved by the operator" is unsupportable; say "an approval artifact exists and is VALID". 10. Output security review summary in chat (Mode A):

  • Blockers (must fix or get approval before deploy)
  • Sensitive-path findings (file:line + concern + mitigation)
  • Approval-required list (operations + missing artifacts)
  • Mitigation steps (concrete next actions)

Output artifacts

ArtifactPath / locationMode
Security summarychat outputMode A
Optional persistent recorddocs/verification/<slug>-security.mdMode B (full)
Approval-required listembedded in summaryMode B (full, table)

Failure cases

Failure modeDetectionResponse
Detected secret in diffregex match on policies/secret-patterns.ymlBLOCK deploy. Redact value in output. Recommend git reset --soft HEAD~1 + rotation. Per FR-12, log incident in docs/problem-catalog/<slug>/.
Missing OR unusable approval artifact for a require_approval opbash hooks/local/approve-local.sh --inventory, then match verdict(strict) against approval-policy.yml: require_approvalBLOCK deploy. Name the artifact AND its verdict — a stale/mismatched artifact is not a missing one, and the operator needs to know which. Surface how to author a replacement.
Auth gate missing on new endpointendpoint added without matching auth middleware import/decoratorBLOCK deploy. Surface specific endpoint + project auth pattern to apply.
Customer-visible message added without approvaloutbound message API call in diff + no external_customer_visible_message approval artifactBLOCK deploy. Per FR-12 + approval-policy.
Production DB write outside repository patterndirect connection / raw SQL outside *Repository.ts / *_repository.pyBLOCK deploy. Surface migration path through repository layer.
App access widened without approval--access gains visitor (public), or --access="" (empty = EVERY org role incl. guest/client; NOT visitors, NOT lockdown — broad internal exposure) in diff/deploy notes, no approval artifactBLOCK deploy. visitor = any unauthenticated user → confirm every reachable surface is public-safe; empty access → confirm org-wide exposure is intended. Require explicit approval either way.
Dashboard write scope broader than SDK usage--permissions grants write on views the runtime only reads (no mutation SDK calls)Finding (non-blocking): narrow to read per least-privilege; blocker if the grant spans client data views.
Gate permissions out of sync with runtime Gate-SDK callsGate-SDK calls changed in diff, no --sync-gate-permissions in deploy stepsBLOCK deploy until sync runs — soft mode masks the gap by silently degrading tokens.
Implicit service-token fallbackuser-facing flow catches Gate 401/403 and retries with service-token authBLOCK. Explicit system/admin endpoints + audit logging only (fusebase-gate security rule).
Export crosses tenant boundary / leaks PIIexport path reads without org/workspace filter, or dumps PII columns not needed downstreamBLOCK deploy. Require scoped query + PII field list in summary + explicit operator go-ahead (approval-policy.yml has no data-export key; auth_or_permission_change applies only if the diff also changes auth/permission code).

Escalation path

  • Live exploit suspected → STOP all flow work, create docs/problem-catalog/incident-<date>/problem.md, alert operator immediately
  • Compliance question (PII handling, GDPR, etc.) → flag as blocker; ask operator for compliance reviewer signoff before proceeding
  • Vendor security advisory affects diff → file backlog ticket; surface as known limitation in this review

Anti-patterns

  • Do NOT print secret values, ever (FR-12 + secret-patterns)
  • Do NOT silently approve missing approval artifacts ("operator probably has it")
  • Do NOT downgrade blockers to non-blockers under deploy pressure
  • Do NOT scan beyond the ticket's diff in v0.1 (full repo audits are out of scope)
  • Do NOT bypass permission_request hook — if it's wired, it's part of the contract

Clean-room note

Original Fusebase Flow content. Designed after reviewing public AI coding workflow patterns; no third-party code, prompts, skill files, or hook scripts are copied. See docs/source-map.md.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.