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
In this repository119 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- .github/copilot-instructions.mdCopilot instructions
- .cursor/rules/fusebase-flow-always.mdcCursor rule
- .cursor/rules/fusebase-flow-implementation.mdcCursor rule
- .cursor/rules/fusebase-flow-security.mdcCursor rule
- .cursor/rules/fusebase-flow-specs.mdcCursor rule
- .cursor/rules/fusebase-flow-validation.mdcCursor rule
- api-explorationSkill
- app-api-contract-testingSkill
- app-backendSkill
- app-business-docsSkill
- app-dev-practicesSkill
- app-e2e-testsSkill
- app-quality-patternsSkill
- app-routingSkill
- app-secretsSkill
- app-sidecarSkill
- app-ui-designSkill
- business-logic-guardianSkill
- client-vs-internalSkill
- code-reviewSkill
- comment-policySkill
- communicationSkill
- design-discovery-ideationSkill
- dev-debug-logsSkill
- documentation-budgetSkill
- file-uploadSkill
- find-wasted-codeSkill
- find-wasted-effortSkill
- fusebase-cliSkill
- fusebase-dashboardsSkill
- fusebase-flow-health-checkSkill
- fusebase-gateSkill
- fusebase-portal-specific-appsSkill
- git-history-diagnosticSkill
- git-workflowSkill
- handling-authentication-errorsSkill
- handoffSkill
- implementation-planningSkill
- invite-with-passwordSkill
- lightweight-laneSkill
- liveness-disciplineSkill
- managed-integrationsSkill
- mcp-gate-debugSkill
- module-size-disciplineSkill
- north-starSkill
- phase-auditSkill
- product-apps-decompositionSkill
- product-docs-firstSkill
- product-ownerSkill
- project-onboardingSkill
- release-deploy-reportingSkill
- remote-logsSkill
- repo-onboarding-context-mapSkill
- requirements-specificationSkill
- role-disciplineSkill
- skill-authoringSkill
- smoke-testingSkill
- task-delegationSkill
- The first 60 shown.
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
- Distinctive: line 59
Run secret-pattern check against added lines: API keys, session cookies, private keys, OAuth tokens, cloud credentials.
- Distinctive: line 116
Do NOT print secret values, ever (FR-12 + secret-patterns)
- Distinctive: line 117
Do NOT silently approve missing approval artifacts ("operator probably has it")
- Distinctive: line 118
Do NOT downgrade blockers to non-blockers under deploy pressure
- Distinctive: line 119
Do NOT scan beyond the ticket's diff in v0.1 (full repo audits are out of scope)
- Very specific: line 120
Do NOT bypass permission_request hook — if it's wired, it's part of the contract
≈ “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.
Files
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
| Input | Where it lives | If missing |
| Diff | git diff <baseline>..HEAD | Stop; ask which diff to review |
| Sensitive paths config | policies/protected-paths.yml (auth + secrets sections) | Use built-in defaults from policy template; flag policy as needing customization |
| Secret patterns | policies/secret-patterns.yml | Use built-in defaults; flag policy as needing customization |
| Approval policy | policies/approval-policy.yml (+ optional .local.yml override) | Stop; FR-12 cannot enforce without policy |
| CLI edition map, for Fusebase Apps work | docs/fusebase-cli-edition.md | Continue 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 ticket | Ask operator for current grants; never assume the app is org-only — an inherited visitor principal changes every finding's severity |
Procedure
- Scan diff for files matching auth/secrets/data patterns from
policies/protected-paths.yml. - For Fusebase Apps diffs, load relevant CLI provider skills (
app-secrets,handling-authentication-errors,fusebase-gate,fusebase-dashboards) as runtime-specific security context. - 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.
- 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. - Permission surface: if role checks added/modified, verify scope is least-privilege; flag overly broad scopes.
- 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).--accessREPLACES the entire principal list — principals aretypeortype:id—visitor, ororgRole:<id>with idsguest,client,member,manager,owner— verify the change neither silently widens (addsvisitor, or adds more org roles than the feature needs; the widest grants are all-org-roles or avisitorprincipal) 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 —writeonly on views the runtime actually mutates (batchPutDashboardData/addRelationRows); read-only SDK usage (getDashboardViewData) getsread. 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-permissionsmust 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 fromfusebase 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 (
getDashboardViewDatafan-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.ymldefines 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).
- App access principals (public-access flag).
- Production data surface: if DB writes added, verify they go through the established repository/transaction pattern; flag direct connection-string writes.
- 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_messageperapproval-policy.yml. - Build approval-required list: every operation in diff that triggers
require_approvalinapproval-policy.ymland lacks an acceptable artifact instate/approvals/. "Acceptable" is no longer "a file exists" (v4.7.0+): review the artifact's state, not its presence — runbash hooks/local/approve-local.sh --inventoryand read theverdict(strict)column.hooks/shared/approval_artifact.pyis the single judge; an artifact can be present and still authorize nothing.
| Verdict | Means | Review response |
VALID | schema, parsed UTC expiry, body/filename action agreement, and any command_digest/repo_id binding all hold | satisfied |
MISSING_EXPIRY | legacy artifact, no expires_at | accepted this release and audit-logged (K7); flag for reissue — it is REJECTED once strict_approvals flips |
EXPIRED / MALFORMED / ACTION_MISMATCH / BINDING_MISMATCH | stale / unparseable / approves a different action / bound to a different command or repo | not 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
| Artifact | Path / location | Mode |
| Security summary | chat output | Mode A |
| Optional persistent record | docs/verification/<slug>-security.md | Mode B (full) |
| Approval-required list | embedded in summary | Mode B (full, table) |
Failure cases
| Failure mode | Detection | Response |
| Detected secret in diff | regex match on policies/secret-patterns.yml | BLOCK 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 op | bash hooks/local/approve-local.sh --inventory, then match verdict(strict) against approval-policy.yml: require_approval | BLOCK 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 endpoint | endpoint added without matching auth middleware import/decorator | BLOCK deploy. Surface specific endpoint + project auth pattern to apply. |
| Customer-visible message added without approval | outbound message API call in diff + no external_customer_visible_message approval artifact | BLOCK deploy. Per FR-12 + approval-policy. |
| Production DB write outside repository pattern | direct connection / raw SQL outside *Repository.ts / *_repository.py | BLOCK 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 artifact | BLOCK 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 calls | Gate-SDK calls changed in diff, no --sync-gate-permissions in deploy steps | BLOCK deploy until sync runs — soft mode masks the gap by silently degrading tokens. |
| Implicit service-token fallback | user-facing flow catches Gate 401/403 and retries with service-token auth | BLOCK. Explicit system/admin endpoints + audit logging only (fusebase-gate security rule). |
| Export crosses tenant boundary / leaks PII | export path reads without org/workspace filter, or dumps PII columns not needed downstream | BLOCK 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_requesthook — 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.
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
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.

