security-agent

Audits FastAPI and frontend code for IDOR, swallowed errors, CORS misconfigurations, and exposed secrets.

Updated Jun 21, 2026
One-click install
npx skills add https://github.com/pu-roi/LANES --skill security-agent-pu-roi
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: security-agent
Source: https://github.com/pu-roi/LANES/tree/main/.agents/skills/security-agent
Command: npx skills add https://github.com/pu-roi/LANES --skill security-agent-pu-roi

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Code written quickly often ships with security flaws like hardcoded secrets, missing authentication checks, and silently swallowed errors. This Skill provides a structured security review checklist to catch these vulnerabilities before they reach production. ## Core Features & Use Cases - Secrets Detection: Scans source code for hardcoded .env variables, API keys, Stripe tokens, and database URLs. - Authentication & IDOR Review: Verifies FastAPI endpoints use dependency injection like Depends(get_current_user) and that users can only access resources they own. - Error Handling & CORS Audit: Flags try/except blocks that only log errors without returning proper HTTP status codes, and checks CORS configuration on the FastAPI backend. - Use Case: Before merging a pull request for a new flood-report endpoint in the LANES backend, invoke this Skill to confirm the endpoint validates session authenticity and resource ownership. ## Quick Start Ask the AI to run a security review on the changed backend files using the security-agent checklist before deployment.

Frequently Asked Questions about security-agent

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I review FastAPI code for security vulnerabilities?▼

Audit each endpoint for authentication via dependency injection like Depends(get_current_user), verify resource ownership checks to prevent IDOR, and confirm no secrets are hardcoded. Also check that errors return proper HTTP status codes instead of being silently logged.

What is IDOR and how do I prevent it in FastAPI?▼

IDOR (Insecure Direct Object Reference) occurs when users access resources they do not own by manipulating identifiers. Prevent it by verifying the logged-in user owns the requested resource after authenticating their session.

How do I detect hardcoded secrets in source code?▼

Search the codebase for .env variable values, API keys, Stripe tokens, and database URLs like postgres:// or http://localhost embedded directly in source files. All sensitive values should live in environment files excluded from version control.

Why are swallowed errors a security problem?▼

Swallowed errors occur when try/except blocks only log failures without returning HTTP status codes or updating the UI. This hides failures from users and operators, making attacks and bugs harder to detect and diagnose.

How should CORS be configured on a FastAPI backend?▼

CORS must be explicitly configured on the FastAPI backend to allow requests from the frontend domain. Without explicit configuration, legitimate frontend requests get blocked or overly permissive settings expose the API to untrusted origins.