$npx skillfedfor your agent

codeshield

Shield against LLM generated insecure code

With conditionsPyPI SecurityReleased Apr 2024110.0K downloads / mopermissive licensePure Python

Decision gist · record as of 2026-08-14

pure-Python wheel — codeshield-1.0.1-py3-none-any.whl
v1.0.1 · released 2024-04-19 · Python >=3.8 · 2 runtime deps: pyyaml, semgrep

Yes, if you deploy LLM-assisted code generation in production or development workflows. CodeShield fills a real gap: LLMs can generate insecure code even when fine-tuned for safety, and this package provides a lightweight, low-latency filter to catch it. Active maintenance, permissive license, and no known vulnerabilities support adoption. Install only if you actually integrate LLM code output into your pipeline; it's not a general-purpose static analyzer.AI-flagged interpretation of the facts on this page — verify before relying

Before you install

  • Requires Python 3.8 or later.
  • semgrep must be installed and functional for static analysis to work across the supported programming languages.
  • Low install friction with a pure Python wheel and only two runtime dependencies (pyyaml and semgrep).

License · maintenance · safety

permissive license (permissive) — Licensed under MIT (permissive), so you can use, modify, and distribute CodeShield freely in commercial and private projects without restriction.

last release 2024-04-19 (847 days) · last repo commit 2026-08-14 · 4,348 stars

0 known vulnerabilities (OSV.dev, 2026-08-14) · 110,025 downloads/mo, #12,486 on PyPI

Verify before relying

pip install codeshield

from codeshield import CodeShield
shield = CodeShield()
result = shield.scan(code_snippet)
  • Exact API surface and configuration options for customizing scan behavior and response modes (warning vs. blocking).
  • Whether the package includes pre-built rules for all 50+ CWEs or requires external configuration.
  • Performance characteristics on code snippets larger than typical LLM outputs.
  • Integration examples with specific IDEs or LLM frameworks beyond the referenced notebook.
Same gist for agents: .md · .json

What it is and what it does

CodeShield is a runtime security filter designed to intercept insecure code generated by large language models before it enters production. It acts as a guardrail in workflows where LLMs assist with code generation—whether as IDE plugins, chatbot code suggestions, or automated coding assistants—flagging or blocking code that violates secure coding practices.

The package uses static analysis (via semgrep and the Insecure Code Detector library) to scan code across multiple programming languages for patterns matching over 50 CWEs. It employs a two-layer scanning strategy: a fast pattern check flags suspicious code, and only flagged content undergoes comprehensive analysis. According to the documentation, this design keeps 99% of benign requests under 70ms latency, with p90 latency at 450ms for thorough scans, making it suitable for production environments where both security and performance matter.

Use it for

  • Block insecure code suggestions in IDE-integrated AI coding assistants before developers see them.
  • Add warnings or reject unsafe code snippets returned by LLM chatbots used for coding help.
  • Scan code generated by automated LLM pipelines to enforce secure coding hygiene before merge.
  • Validate code produced by internal or third-party LLM services in CI/CD workflows.
  • Detect common insecure patterns (CWE violations) in bulk-generated code for compliance audits.

Worth the install?

AI-flagged interpretation of the facts on this page. Verify before relying on it.

With conditions

Yes, if you deploy LLM-assisted code generation in production or development workflows.

CodeShield fills a real gap: LLMs can generate insecure code even when fine-tuned for safety, and this package provides a lightweight, low-latency filter to catch it. Active maintenance, permissive license, and no known vulnerabilities support adoption. Install only if you actually integrate LLM code output into your pipeline; it's not a general-purpose static analyzer.

Install

codeshield on PyPI

Before you install

Low install friction with a pure Python wheel and only two runtime dependencies (pyyaml and semgrep). The package is actively maintained with recent commits and has accumulated 4348 repository stars, indicating established community adoption.

Requires Python 3.8 or later. semgrep must be installed and functional for static analysis to work across the supported programming languages.

License in practice

Licensed under MIT (permissive), so you can use, modify, and distribute CodeShield freely in commercial and private projects without restriction.

Quickstart

pip install codeshield

from codeshield import CodeShield
shield = CodeShield()
result = shield.scan(code_snippet)

Verify before relying

  • Exact API surface and configuration options for customizing scan behavior and response modes (warning vs. blocking).
  • Whether the package includes pre-built rules for all 50+ CWEs or requires external configuration.
  • Performance characteristics on code snippets larger than typical LLM outputs.
  • Integration examples with specific IDEs or LLM frameworks beyond the referenced notebook.

Package facts

Licensepermissive license permissive
Python supportSupports the current Python release >=3.8
Install frictionLow. Pure-Python wheel
Runtime dependencies
2 packages
pyyamlsemgrep
MaintenanceActively maintained 847 days since the last release
Last repo commit
First released
Downloads110,025 / month, #12,486 on PyPI 30-day window, as of 2026-08-14
Known vulnerabilitiesNone known OSV.dev, checked 2026-08-14
Classifiers
License :: OSI Approved :: MIT LicenseOperating System :: OS IndependentProgramming Language :: Python :: 3

Evidence: codeshield-1.0.1-py3-none-any.whl

Tags

Capabilities
llm code security filteringinsecure code detectionai-generated code guardrailstatic analysis for llm outputcode generation safetysecure coding enforcementllm output validation
Topics
llm-securitycode-scanningguardrail

Let your AI agent find packages like this

Example. Real query, live index.

You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.

wish › “llm code security filtering”

  • codeshieldCodeShield filters code generated by LLMs to detect and block…
  • llm-guardLLM Guard provides input and output scanning for Large Language…
  • vannaVanna converts natural language questions into SQL queries and…

Give your agent the search over MCP, or paste the wish link into any chat.

More Security packages

SecretStorage With conditions
PyPI · Python Modules · released Nov 2025

Provides Python bindings to the FreeDesktop.org Secret Service API for securely storing and retrieving passwords and secrets through GNOME Keyring, KWallet, or KeePassXC.

BSD-3-Clausepure Python · 3.10+aging
226.9Mdownloads / mo
msal Worth it
PyPI · Security · released May 2026

MSAL for Python handles OAuth2 and OpenID Connect authentication with Microsoft identity services, managing token acquisition, caching, and refresh for applications integrating with Microsoft Entra ID, Microsoft Accounts, and Azure AD B2C.

MITpure Python · 3.9+
223.0Mdownloads / mo
joserfc Worth it
PyPI · Security · released Jul 2026

joserfc implements JOSE standards (JWS, JWE, JWK, JWT, and related RFCs) for signing, encrypting, and managing JSON-based cryptographic tokens in Python.

BSD-3-Clausepure Python · 3.10+
155.5Mdownloads / mo
Authlib Worth it
PyPI · Security · released May 2026

Authlib provides a complete implementation of OAuth 1.0, OAuth 2.0, and OpenID Connect 1.0 for building both authentication clients and servers, with built-in support for JWS, JWK, JWA, and JWT standards.

BSD-3-Clausepure Python · 3.10+
155.1Mdownloads / mo
argon2-cffi-bindings With conditions
PyPI · Python Modules · released Jul 2025

Provides low-level CFFI bindings to the official Argon2 password hashing algorithm for use by libraries and applications that need direct access to Argon2 without higher-level abstractions.

MITcompiled wheel · 3.9+
74.2Mdownloads / mo
adal Skip
PyPI · Security · released Apr 2021

ADAL for Python authenticates applications with Azure Active Directory to obtain tokens for accessing Azure AD-protected resources.

Install only if maintaining existing code that already depends on it, and plan a migration.

MITpure Pythonabandoned
44.5Mdownloads / mo

See also guardrails-ai · openai-guardrails · pydantic-ai-shields · llm-guard · cisco-ai-mcp-scanner · smg-grpc-servicer · njsscan · cisco-ai-skill-scanner · mobsfscan · guarddog

Further reading