agentic-security:security-eval-warn

Detect and refuse runtime code-eval patterns across major languages.

73|15|Updated May 6, 2026
One-click install
npx skills add https://github.com/Clear-Capabilities/agentic-security --skill agentic-security-security-eval-warn
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: agentic-security:security-eval-warn
Source: https://github.com/Clear-Capabilities/agentic-security/tree/main/skills/security-eval-warn
Command: npx skills add https://github.com/Clear-Capabilities/agentic-security --skill agentic-security-security-eval-warn

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Prevents runtime code-eval on user input, reducing the risk of remote code execution by blocking untrusted strings from triggering eval-style calls.

Core Features & Use Cases

  • Detection: Identifies common eval and sandbox-escape patterns across languages (JS/TS: eval, new Function, setTimeout with string, vm calls; Python: eval/exec/compile/import, globals; Ruby: eval/class_eval/instance_eval; PHP: eval, assert, create_function; Shell-from-JS: exec, execSync, child_process variants; Templating engines: Mustache.render, Handlebars.compile with user input).
  • Protection: Refuses the evaluated input and proposes a structured, safer alternative.
  • Use Case: Guarding an API endpoint that accepts user-provided code snippets to ensure no runtime execution occurs.

Quick Start

Refuse any runtime code-eval request from untrusted input and propose a safe, sandboxed alternative.

Frequently Asked Questions about agentic-security:security-eval-warn

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

FAQPage Schema
How do I prevent runtime code-eval on untrusted user input?

This approach diagnoses eval-style patterns across major languages and refuses the evaluated string to block untrusted input from triggering remote code execution. It then proposes structured, safer alternatives to achieve the same functionality without dynamic execution.

What common eval and sandbox-escape patterns should I look for in JavaScript and Python?

Common eval and sandbox-escape patterns include eval, new Function, and vm calls in JavaScript, alongside eval, exec, compile, and __import__ in Python. Identifying these patterns prevents untrusted strings from triggering dangerous runtime execution.

How do I safely accept user-provided code snippets in an API endpoint?

To safely accept user-provided code snippets in an API endpoint, refuse any runtime code-eval request from the untrusted input. You should then propose a safe, sandboxed alternative or structured replacement to process the data without executing it.

Does this security eval approach work across different languages and templating engines?

Yes, this security eval approach works across major languages and runtimes including JavaScript, Python, Ruby, and PHP. It also detects dangerous patterns in templating engines like Mustache and Handlebars when they compile user input.

When should I use a trust pragma instead of a safe alternative for code evaluation?

You should use a trust pragma when a safe, structured alternative cannot replace the required eval-style call. It documents the explicit trust boundary needed for the runtime execution, ensuring the code-eval remains intentional and secured.