Skip to content
Back to skills

Independent Security Review

ASecurity

Independent security review of a change, read-only — authentication and sessions, authorization and tenant isolation, audit, input validation, secrets and logs, external integrations and SSRF, supply chain; PASS/FAIL report with evidence against the project's ADRs (security review, authn, authz, tenant isolation, CSRF, secrets, supply chain).

  • 5 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added December 3, 2026
ai-agentsrustgosqltestingcode-reviewgitapisecurity

Works with

  • cli
  • api
  • mcp

Security analysis

A100/100

Scanned December 3, 2026

npx -y skills add vectora-os/kit --skill independent-security-review --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Independent Security Review?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Independent Security Review
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/vectora-os-independent-security-review/badge)](https://www.skillsdirectory.com/skills/vectora-os-independent-security-review)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: independent-security-review
description: Independent security review of a change, read-only — authentication and sessions, authorization and tenant isolation, audit, input validation, secrets and logs, external integrations and SSRF, supply chain; PASS/FAIL report with evidence against the project's ADRs (security review, authn, authz, tenant isolation, CSRF, secrets, supply chain).
metadata:
  category: security
---

# Independent security review

## Purpose

This skill is a reviewer, not an author: it reads the diff and the code, runs tests and checks, writes a report and **does not change files**. Run it in a separate session or subagent, not in the one where the code was written, and not on behalf of the change's author (the independent review rule from [engineering standards](../../../standards/README.md) and [docs/agents.md](../../../docs/agents.md#rules-and-authority)). Required before merging changes to authentication, authorization, sessions, external integrations, secrets, dependencies and personal data. It complements the built-in `/security-review` with a checklist based on this repository's ADRs.

A result is phrased as "conforms to ADR NNNN" or "requires the owner's confirmation"; the words "compliant" and "certified" are not used. No active attacks on environments, scanning of third-party systems or exploitation attempts.

## Inputs

- Diff, threat model, ADRs, task card.

## Outputs

- PASS/FAIL security report (`templates/security-report.md`).

## Read first

- [Project Brain](../../../project-brain/README.md) — `npm run brain -- query "security review"` for prior decisions, patterns and lessons.
- [AGENTS.md](../../../AGENTS.md) — the "Invariants" and "Restrictions" sections: which security guarantees the project declared mandatory.
- [ADR register](../../../docs/adr/README.md) — accepted decisions on authentication, access, isolation, data storage, integrations and dependencies. The checklist below is checked against them, not against general notions.
- The threat model, if the project has one (for example `docs/security/threat-model.md`) — the list of threats and mitigations to verify in this change; it is built by the `threat-modeling` skill.
- [Glossary](../../../docs/glossary.md) — project terms (tenant, scope, role).
- The review diff: `git diff <base>...HEAD` and the list of affected modules.

## Steps

1. **Define the surface.** From the diff, mark the affected classes: public and internal API routes, sign-in and sessions, permissions and roles, tables with tenant data or personal data, logs and audit, external integrations and webhooks, configuration and secrets, dependencies, images and CI.
   Done when every class has a checklist section below or is marked "not affected".
2. **Go through the checklist** only for the affected sections. Every item is PASS, FAIL or "no data" with a link to a file and line or to a test that proves it. A claim without a test or a code line is "no data".
   Done when every item has a status and evidence.
3. **Run checks** (read-only and tests): `npm run check`, a dependency audit with the project's package manager (for example `npm audit --omit=dev`), `grep` for forbidden patterns (secrets, disabled TLS verification, `eval`, raw SQL built from strings). Fix nothing.
   Done when the command output is attached to the report.
4. **Write the report** per the template below.
   Done when every FAIL has a risk level and a link to an ADR, an invariant from `AGENTS.md`, or "no decision — question for the owner".

## Checklist

**Authentication and sessions.** The sign-in method is the one accepted in an ADR; the token's issuer, audience, signature and expiry are verified, `state`/`nonce`/PKCE where applicable. A user is matched by a stable identifier, not by email. There are absolute and idle session timeouts; the session ID changes after sign-in and privilege elevation; sign-out and revocation work on the server. Risky actions require re-confirmation (step-up) if an ADR describes it. Passwords, if any, use a modern slow hash function; account recovery responses are neutral. What the ADR does not define — "no data" and a question for the owner.

**Browser and cookies.** The session cookie is opaque, `Secure`, `HttpOnly`, with a deliberate `SameSite`, without an unnecessary domain attribute; state-changing requests are protected against CSRF (a token and/or an `Origin` check); access tokens for internal services never reach the browser. Responses with personal data use `Cache-Control: no-store`. CORS does not allow arbitrary origins with credentials.

**Authorization and tenant isolation.** Every route checks authentication and permissions before searching, filtering and pagination; the scope (tenant, organization, project) comes from the credentials, not from client parameters; someone else's resource returns `404`, not `403` that confirms it exists. If isolation is also enforced in storage (row-level policies, separate schemas), a new table with tenant data is covered by a policy, the application role does not own the table and does not bypass the policy, the scope does not leak between requests through the connection pool; there are tests "no scope → 0 rows" and "another tenant → `404`". Cross-tenant operations use a separate role with a list of scopes and audit. A new role or privilege without an ADR is a finding.

**Separation of duties.** If the project requires confirmation by a second person, the author does not approve their own change; independence is checked by immutable IDs; the approval is bound to the object's version, and a new version invalidates it. A test for self-approval exists.

**Audit.** A successful privileged command writes an audit record in the same transaction; denials are recorded separately. Audit records are not modified or deleted by the application role.

**Input validation and output.** Input is validated by a schema at the boundary; storage queries are parameterized; no deserialization of untrusted data into executable objects; file paths and uploads are restricted; HTML output is escaped. Errors do not reveal stack traces, SQL or internal IDs. Public routes have rate and body size limits where an ADR requires them.

**External integrations and webhooks.** Incoming calls verify the signature over the raw body, a timestamp and a one-time ID (replay protection); keys are rotated with overlap. Outgoing addresses come only from approved configuration, without addresses or redirects from the request (SSRF); TLS verification is not disabled. If the signature algorithm, time window or mTLS are not defined — a question for the contract owner.

**Secrets and logs.** Secrets live only in a secret store or the environment's variables; no secrets in the repository, images, command-line arguments or build logs; `.env*` (except `.env.example`) is not read by agents and not committed, as enforced in [.claude/settings.json](../../../.claude/settings.json). Logs and traces contain no request bodies, tokens, signatures, passwords or unnecessary personal data (ideally a test of the log serializer). New MCP servers in [.mcp.json](../../../.mcp.json) get no production access or secrets.

**Supply chain.** A new dependency is justified (an ADR if the project requires it); the lockfile is updated, installation is reproducible (`npm ci` or equivalent); package install scripts are not allowed without a reason; the dependency audit has no high/critical findings, or there is a recorded exception with an owner. Check whether the project defines pinning of images and CI actions by digest or version, an SBOM, artifact signing and secret scanning in CI; what is missing — "no data".

## Report

```markdown
# Security review: <PR or branch>

| Section | Item | Status | Risk | Evidence | ADR / invariant |
| --- | --- | --- | --- | --- | --- |

Risks: critical — authentication bypass, access to another tenant's data, secret leak; high — personal data leak, privilege escalation; medium — no test for a guarantee; low — hygiene.
Command output: ...
Open questions for the owner: ...
Requires confirmation by a lawyer: ...
Conclusion: ready to merge / not ready to merge until critical and high FAILs are fixed.
```

## Best practices

- Start from the threat model's review items.
- Test negative access paths.
- Never include secret values in reports.

## Common mistakes

- Reviewing your own change.
- Calling something "compliant".
- Active attacks on environments.

## Example

Sharing PR: FAIL — IDOR at `share.controller.ts:88` (no tenant scope); PASS on secrets, logging, dependencies.

## Reusable prompt

```text
Apply the independent-security-review skill (.agents/skills/independent-security-review/SKILL.md).
Context: {{task card or question; links to PRD, ADRs, code paths}}
Constraints: {{approved thresholds, deadlines, allowed files}}
Review the change against the checklist and ADRs in read-only mode and return PASS/FAIL with evidence per item.
Cite evidence for every claim; list open questions separately.
```

## Checks

- [ ] The review ran in a separate session and not by the change's author; no file was changed.
- [ ] Every item of the affected sections has a status and evidence (file:line or a test).
- [ ] The output of `npm run check` and the dependency audit is attached.
- [ ] Every FAIL has a risk level and a link to an ADR, an invariant or an open question.
- [ ] No active attacks, scanning of external systems or production access took place.
- [ ] The words "compliant" and "certified" are not used.

## Out of scope

- Fixing what was found — the change's author (`software-engineer`) per the `task-execution` skill, then a repeat review.
- The threat model of a feature or system — `threat-modeling` (`security-architect`).
- Personal data in substance (minimization, retention, data subject requests) — `privacy`.
- General code review — `independent-code-review`.
- Legal assessment — a lawyer; penetration testing — only an authorized specialist with separate permission, not an agent.
- Approving the change — the responsible person per [engineering standards](../../../standards/README.md); the skill's report is an input for them.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.