ankyr-security

Enforces vulnerability prevention rules for injection, XSS, CSRF, auth, and secret handling in code.

1|Updated May 21, 2026
One-click install
npx skills add https://github.com/GuyErreich/AI_Agents --skill ankyr-security-guyerreich
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: ankyr-security
Source: https://github.com/GuyErreich/AI_Agents/tree/main/plugins/ankyr/skills/ankyr-security
Command: npx skills add https://github.com/GuyErreich/AI_Agents --skill ankyr-security-guyerreich

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Code that touches user input, authentication, API routes, or sensitive data often ships with preventable vulnerabilities like SQL injection, XSS, CSRF gaps, leaked secrets, and unsafe error logging. This Skill gives the AI a non-negotiable security floor and concrete remediation patterns so these issues are caught and prevented during code generation and review. ## Core Features & Use Cases - Injection and XSS prevention: Enforces parameterized queries, framework auto-escaping, and DOMPurify sanitization with explicit tag/attribute allow-lists before rendering user-supplied HTML. - Auth, session, and CSRF hardening: Validates sessions on every protected path, sets secure cookie flags (httpOnly, secure, sameSite), and requires origin checks or anti-CSRF tokens on state-changing requests. - Secret and input safety: Blocks hardcoded or client-exposed secrets, mandates server-side whitelist validation, safe error logging without PII, upload MIME/size checks, and schema validation of external API responses. - Use Case: While building a login endpoint with file upload, the Skill ensures the session is validated, the upload is checked for MIME type and size, no secrets leak into client env vars, and only generic errors reach the user. ## Quick Start Review this API route for injection, XSS, auth, and secret-handling vulnerabilities using the security skill.

Frequently Asked Questions about ankyr-security

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

FAQPage Schema
How do I prevent SQL injection in my queries?▼

Prevent SQL injection by never interpolating user input into queries; use parameterized queries or the data layer's parameter binding instead. Pass values separately from the query string, such as placeholders like $1 with a values array, so input is treated as a literal.

How to sanitize user HTML to prevent XSS in React?▼

Sanitize user HTML with DOMPurify before passing it to dangerouslySetInnerHTML, using an explicit allow-list of tags and attributes. Framework auto-escaping already protects interpolated text; the risk only appears when rendering raw HTML from user input.

What cookie flags should I use for session tokens?▼

Set session cookies with httpOnly to block JavaScript access, secure to restrict to HTTPS, and sameSite set to Strict to mitigate CSRF. These flags apply to server-set session tokens and should be combined with session validation on every protected path.

Can I use client-side validation instead of server-side checks?▼

No, client-side validation is UX only and can be bypassed. Enforce format, length, and type checks on the server, and whitelist allowed values rather than blacklisting, since attackers find variations around blocklists.

Why should errors shown to users be generic?▼

Generic user-facing errors prevent leaking internals like IPs, ports, and stack traces to attackers. Full detail belongs in server logs only, and logs must contain only safe messages, never raw errors, secrets, or PII.

How do I keep secrets out of client-side code?▼

Keep server-only secrets out of client-inlined environment variables, since bundlers inline public-prefixed variables into shipped output. Store sensitive values in a server or edge secret store and never hardcode keys in source code.