[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-80820":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":12,"openIssues":14,"contributorsCount":14,"subscribersCount":14,"size":14,"stars1d":14,"stars7d":14,"stars30d":14,"stars90d":14,"forks30d":14,"starsTrendScore":14,"compositeScore":15,"rankGlobal":10,"rankLanguage":10,"license":16,"archived":17,"fork":17,"defaultBranch":18,"hasWiki":17,"hasPages":17,"topics":19,"createdAt":10,"pushedAt":10,"updatedAt":28,"readmeContent":29,"aiSummary":30,"trendingCount":14,"starSnapshotCount":14,"syncStatus":13,"lastSyncTime":31,"discoverSource":32},80820,"redlyne","redlyne-ai\u002Fredlyne","redlyne-ai","Detect and patch vulnerabilities in AI-generated Python code — VS Code extension","https:\u002F\u002Fredlyne.io",null,"Python",37,2,0,41.43,"Apache License 2.0",false,"main",[20,21,22,23,24,25,26,27],"ai-generated-code","code-security","llm-security","python","security","static-analysis","vscode-extension","vulnerability-detection","2026-06-12 04:01:30","\u003Cdiv align=\"center\">\n  \u003Cimg src=\"images\u002Ficon.png\" alt=\"Redlyne\" width=\"128\" \u002F>\n\n  # Redlyne\n\n  **Detect and patch vulnerabilities in AI-generated Python code, directly from your editor.**\n\n  [![License: Apache 2.0](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FLicense-Apache%202.0-blue.svg)](LICENSE.md)\n  [![VS Code Marketplace](https:\u002F\u002Fimg.shields.io\u002Fvisual-studio-marketplace\u002Fv\u002Fredlyne.redlyne-ai?label=Marketplace)](https:\u002F\u002Fmarketplace.visualstudio.com\u002Fitems?itemName=redlyne.redlyne-ai)\n  [![Platform](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Fplatform-Windows%20%7C%20macOS%20%7C%20Linux-success)](#status)\n  [![Website](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Fwebsite-redlyne.io-red)](https:\u002F\u002Fredlyne.io)\n\n  [Website](https:\u002F\u002Fredlyne.io) ·\n  [Marketplace](https:\u002F\u002Fmarketplace.visualstudio.com\u002Fitems?itemName=redlyne.redlyne-ai) ·\n  [Issues](https:\u002F\u002Fgithub.com\u002Fredlyne-ai\u002Fredlyne\u002Fissues) ·\n  [Discussions](https:\u002F\u002Fgithub.com\u002Fredlyne-ai\u002Fredlyne\u002Fdiscussions)\n\u003C\u002Fdiv>\n\n---\n\n[Redlyne](https:\u002F\u002Fredlyne.io) is a VS Code extension that scans Python code — especially code generated by AI assistants like Copilot, ChatGPT, or Claude — for known vulnerability patterns, and proposes one-click in-editor patches you can apply with a single confirmation.\n\nIt runs entirely on your machine. No code is sent to any server.\n\n> **Built _for_ AI. Built _without_ AI.**\n> Redlyne is powered by a deterministic rule engine — no LLM, no probabilistic guesses, no hallucinated fixes. The detection rules are hand-crafted by security researchers, not auto-generated. Every flag and every remediation suggestion is reproducible and auditable.\n\n## Why Redlyne\n\nAI coding assistants are fast, and they're also reliably insecure. In a 2025 study evaluating 609 Python snippets generated by GitHub Copilot, Claude 3.7 Sonnet, and DeepSeek V3, **~76% of the code contained security vulnerabilities** — for GitHub Copilot specifically the rate climbs to **~84%** ([source](https:\u002F\u002Fdoi.org\u002F10.1109\u002FDSN-W65791.2025.00077)). The patterns are well-known to security engineers: SQL injection from string concatenation, command injection from `os.system`, weak crypto defaults, hard-coded secrets, unsafe deserialization, path traversal, SSRF, and more.\n\nThere's also a structural problem alongside the security one. A 2025 study analyzing 500 Python snippets across four AI assistants found that **~13% of them are incomplete** — missing imports or context. For GitHub Copilot specifically, that number rises to **~31%** — almost one snippet in three ([source](https:\u002F\u002Fdoi.org\u002F10.1016\u002Fj.infsof.2024.107572)). AST-based analyzers like Bandit, CodeQL, and PyT can't process those snippets at all: without a parseable program, they can't build the tree they rely on.\n\nRedlyne sits in your editor and flags vulnerability patterns the moment you select the snippet, then offers a remediated version. Pattern-based detection works on any fragment, complete or not. Instead of relying on another LLM to find LLM bugs, it uses a curated set of deterministic rules built by people whose job is to find vulnerabilities.\n\n## Features\n\n- **Built for AI, built without AI** — deterministic rule engine, no LLM, no hallucinations, every flag is reproducible\n- **Expert-curated rule set** — 459 detection patterns mapped to OWASP Top 10:2025 categories observed in AI-generated Python code, derived from the [SecurityEval](https:\u002F\u002Fgithub.com\u002Fs2e-lab\u002FSecurityEval), [Copilot CWE Scenarios](https:\u002F\u002Fzenodo.org\u002Frecords\u002F5225651), and [PoisonPy](https:\u002F\u002Fgithub.com\u002Fdessertlab\u002FTargeted-Data-Poisoning-Attacks) benchmarks\n- **Static vulnerability detection** on Python code selected in the editor\n- **Automated remediation suggestions**, applied as in-place edits to the source file with your explicit confirmation\n- **Right-click integration** in the editor context menu for any Python selection\n- **Local execution** — your code never leaves your machine\n\n## What's inside\n\n- **459 deterministic detection rules** mapped to **OWASP Top 10:2025** categories — see the [full list in COVERAGE.md](COVERAGE.md)\n- **70+ rules with auto-remediation**, including 14 multi-line templates that rewrite vulnerable blocks while preserving indentation and adding required imports\n- **~70-100 ms** per snippet on a typical laptop\n- Rules derived from analysis of **vulnerable Python samples** in state-of-the-art security benchmark datasets\n- Each detected vulnerability comes with an **automated patch suggestion** — not a comment, not an LLM guess, but a concrete code replacement\n- **Auto-fixes verified end-to-end**: every patch is checked for syntax safety, regression-freedom, and that the targeted rule actually stops firing — **9 out of 10 patches** on PoisonPy pass all three checks\n\n## Measured performance\n\n*Evaluated May 2026 across 1700+ vulnerable Python samples spanning five public benchmark datasets.* Full cross-dataset numbers in [Head-to-head with open-source baselines](#head-to-head-with-open-source-baselines).\n\n### Detection on PoisonPy\n\n> **96.8% recall · 0.822 F1 · 459 rules in ~1 ms per file**\n\n| Metric | Value |\n|---|---|\n| **Recall** | **96.8%** |\n| **F1 score** | **0.822** |\n| **Accuracy** | **79.0%** |\n| Precision | 71.4% |\n| Analyzed | 100% (310\u002F310 files, no parse failures) |\n| Time on full dataset (310 files) | ~0.4s |\n\nRecall on PoisonPy is **higher than the baseline reported in the original paper** (~91%) — Redlyne extends the rule set to 459 patterns and catches more issue classes.\n\n### Patching correctness\n\n> **9 out of 10 auto-fixes verified safe**\n\nWhen Redlyne emits a patch, the fix is checked against three independent correctness properties:\n\n| Check | What it means | Pass rate on PoisonPy applied patches |\n|---|---|---|\n| **Syntax-safe** | Patched code compiles as valid Python | **100%** (58\u002F58) |\n| **Regression-free** | No new rule classes appear after the patch | **93%** (54\u002F58) |\n| **Targeted-clean** | The specific rule that fired stops firing | **97%** (56\u002F58) |\n| **Targeted-full** (all three above) | The patch did its job | **90%** (52\u002F58) |\n\nIn other words: of every patch Redlyne emits, **9 out of 10 successfully remove the targeted vulnerability without breaking syntax or introducing a new rule class**.\n\n### Reproducibility\n\n```bash\npython tests\u002Fbench_baselines.py    # detection across 5 datasets (Redlyne + 4 baselines)\npython tests\u002Fbench_remediation.py  # auto-fix head-to-head (Redlyne + PatchitPy + Semgrep)\n```\n\nBoth produce JSON + Markdown reports under `benchmarks\u002F` in a few minutes.\n\n### Head-to-head with open-source baselines\n\n*Evaluated May 2026 across 1700+ vulnerable Python samples spanning five public benchmarks. Reproducible: `python tests\u002Fbench_baselines.py`.*\n\n**Tools compared:** [Bandit](https:\u002F\u002Fgithub.com\u002FPyCQA\u002Fbandit) · [Semgrep](https:\u002F\u002Fgithub.com\u002Fsemgrep\u002Fsemgrep) · [Pylint](https:\u002F\u002Fgithub.com\u002Fpylint-dev\u002Fpylint) · [DeVAIC v2](https:\u002F\u002Fgithub.com\u002Fdessertlab\u002FDeVAIC) · Redlyne.\n\n#### The bottom line\n\nAcross every dimension that matters — files actually analyzed, accuracy, speed, fix safety — Redlyne is the only tool that wins on all of them at once.\n\n| | Bandit | Semgrep | Pylint | DeVAIC v2 | **Redlyne** |\n|---|---|---|---|---|---|\n| **Analyzed** *(% of PoisonPy parsed, not skipped)* | 17% | 86% | 17% | 100% | **100%** ✓ |\n| **Recall** *(PoisonPy, % of vulns caught)* | 5.8% | 20.6% | 18.7% | 64.5% | **96.8%** ✓ |\n| **F1** *(PoisonPy)* | 0.107 | 0.318 | 0.280 | 0.662 | **0.822** ✓ |\n| **Speed** *(ms per file)* | ~20 | ~700 | ~55 | ~0.5 | **~1.4** *(top tier)* |\n| **Auto-fix?** | ✗ | partial *(~5% of rules)* | ✗ | ✗ *(2 of 441 rules)* | **✓** *(70+ rules)* |\n\n#### The gap, in plain numbers\n\n| Versus | Recall gap | Analyzed gap | Speed |\n|---|---|---|---|\n| Bandit | **+91.0 pp** | **+83 pp** | **~14× faster** |\n| Pylint | **+78.1 pp** | **+83 pp** | **~40× faster** |\n| Semgrep | **+76.2 pp** | **+14 pp** | **~500× faster** |\n| DeVAIC v2 (same engine, original rule set) | **+32.3 pp** | tied at 100% | comparable |\n\n#### Speed comparison — full PoisonPy run (310 files)\n\n```\nRedlyne    ▏  0.4 s\nDeVAIC v2  ▏  0.2 s\nBandit     █████ 6.2 s\nPylint     ███████████████ 17 s\nSemgrep    ████████████████████████████████████████████████████ 217 s\n```\n\n#### Generalization across datasets\n\n**Datasets used:** [PoisonPy](https:\u002F\u002Fgithub.com\u002Fdessertlab\u002FTargeted-Data-Poisoning-Attacks) · [SafeCoder](https:\u002F\u002Fgithub.com\u002Feth-sri\u002Fsafecoder) · [SecurityEval](https:\u002F\u002Fgithub.com\u002Fs2e-lab\u002FSecurityEval) · [Copilot CWE Scenarios](https:\u002F\u002Fzenodo.org\u002Frecords\u002F5225651) · [PromSec](https:\u002F\u002Fgithub.com\u002Fmahmoudkanazzal\u002FPromSec).\n\nThe advantage isn't a PoisonPy artifact. Headline metric per dataset, all five tools side-by-side — F1 for paired datasets (where precision is measurable), recall for vulnerable-only:\n\n| Dataset | n | Bandit | Semgrep | Pylint | DeVAIC v2 | **Redlyne** |\n|---|---|---|---|---|---|---|\n| PoisonPy *(paired, F1)* | 310 | 0.107 | 0.318 | 0.280 | 0.662 | **0.822** |\n| SafeCoder *(paired, F1)* — real OSS commit fixes | 1052 | 0.435 | 0.515 | 0.449 | 0.501 | **0.556** |\n| SecurityEval *(recall)* | 121 | 40.5% | 34.7% | 59.5% | 63.6% | **93.4%** |\n| Copilot CWE Scenarios *(recall)* | 150 | 84.7% | 51.3% | 93.3% | 68.0% | 89.3% |\n| PromSec *(recall)* | 600 | 92.8% | 87.0% | 98.8% | 85.2% | 97.0% |\n\nOn Copilot and PromSec, Pylint's \"flag almost everything\" mode nudges it slightly above Redlyne on raw recall, but at the cost of a 49.7% accuracy on the paired benchmarks — effectively a random classifier on the only datasets where precision is measurable. What matters in production is F1 on paired data, and there Redlyne leads on both paired datasets.\n\n### Auto-remediation head-to-head\n\n*Evaluated May 2026 on 155 [PoisonPy](https:\u002F\u002Fgithub.com\u002Fdessertlab\u002FTargeted-Data-Poisoning-Attacks) vulnerable samples + 526 [SafeCoder](https:\u002F\u002Fgithub.com\u002Feth-sri\u002Fsafecoder) real commit-based fixes. Reproducible: `python tests\u002Fbench_remediation.py`.*\n\n**Tools compared:** [Semgrep `--autofix`](https:\u002F\u002Fsemgrep.dev\u002Fdocs\u002Fwriting-rules\u002Fautofix) · [PatchitPy](https:\u002F\u002Fgithub.com\u002Fdessertlab\u002FPatchitPy) · Redlyne.\n\nAuto-remediation is the dimension where Redlyne has no real competition. Of the open-source Python tools we tested:\n\n| Tool | Patches emitted | **Successful fix rate** | Latency per file |\n|---|---|---|---|\n| Semgrep `--autofix` | 7 \u002F 155 *(4.5%)* | 71% | ~4700 ms |\n| **Redlyne** | **58 \u002F 155** *(37%)* | **90%** ✓ | **~3 ms** ✓ |\n\n> **Of every patch Redlyne emits, 9 out of 10 successfully remove the targeted vulnerability** — verified by an independent rule re-scan, with the patched source compiling and no new vulnerability classes introduced. Redlyne is also ~1500× faster than Semgrep autofix per file.\n\nDeVAIC v2 stock ships only 2 remediation rules out of 441 (0.5%), so it isn't a remediation tool — it stays in the detection comparison above. On SafeCoder (526 real-world commit fixes) Redlyne applies a patch on 19% of samples, with 69% of those passing the same check; the drop reflects how often production fixes involve function-level refactoring rather than the drop-in substitutions our regex-based remediations target.\n\n### References\n\nRedlyne builds on two peer-reviewed lines of research:\n\n> Cotroneo, D., De Luca, R., Liguori, P. (2025). **DeVAIC: A tool for security assessment of AI-generated code**. *Information and Software Technology*, 177, 107572. [DOI 10.1016\u002Fj.infsof.2024.107572](https:\u002F\u002Fdoi.org\u002F10.1016\u002Fj.infsof.2024.107572)\n>\n> The detection rule schema. Redlyne extends the v2.0 rule set introduced in this paper to 459 patterns and adds the `pattern_not_file` directive for scope-aware sanitization detection.\n\n> Altiero, F., Cotroneo, D., De Luca, R., Liguori, P. (2025). **Securing AI Code Generation Through Automated Pattern-Based Patching**. *2025 55th Annual IEEE\u002FIFIP International Conference on Dependable Systems and Networks Workshops (DSN-W)*, pp. 282–289. [DOI 10.1109\u002FDSN-W65791.2025.00077](https:\u002F\u002Fdoi.org\u002F10.1109\u002FDSN-W65791.2025.00077)\n>\n> The automated remediation approach. Redlyne extends pattern-based patching with multi-line template rules, syntax-safety verification, and the targeted-clean rule re-scan.\n\nThe PoisonPy benchmark dataset is published in:\n\n> Cotroneo, D., Improta, C., Liguori, P., Natella, R. (2024). **Vulnerabilities in AI Code Generators: Exploring Targeted Data Poisoning Attacks**. *Proceedings of the 32nd IEEE\u002FACM International Conference on Program Comprehension (ICPC '24)*, pp. 280–292. [DOI 10.1145\u002F3643916.3644416](https:\u002F\u002Fdoi.org\u002F10.1145\u002F3643916.3644416)\n\n## Installation\n\nFrom the VS Code Marketplace (recommended):\n\n1. Open VS Code\n2. Extensions panel (`Ctrl+Shift+X`)\n3. Search for `Redlyne`\n4. Click **Install**\n\nFrom the command line:\n\n```bash\ncode --install-extension redlyne.redlyne-ai\n```\n\nFrom a `.vsix` (manual install):\n\n1. Download the latest `redlyne-x.y.z.vsix` from [Releases](https:\u002F\u002Fgithub.com\u002Fredlyne-ai\u002Fredlyne\u002Freleases)\n2. In VS Code, run `Extensions: Install from VSIX...` from the Command Palette\n3. Select the downloaded file\n\n## Usage\n\n1. Open a Python file (`.py`) in VS Code\n2. Select the block of code you want to analyze\n3. Right-click the selection → **Redlyne: Run Analysis**\n4. Review the notifications\n5. Confirm to apply the suggested patch\n\nThe same command is also available from the Command Palette (`Ctrl+Shift+P` → \"Redlyne: Run Analysis\").\n\n## Requirements\n\nRedlyne runs natively on **Windows, macOS, and Linux** — no WSL, no bash, no jq.\n\nBefore using the extension, make sure you have:\n\n- **Python 3.10+** on `PATH` (`python3` on macOS\u002FLinux, `python` or `py` on Windows)\n- VS Code 1.89 or newer\n\n## Status\n\nRedlyne is in **early access**. The detection engine is fast, cross-platform, and ready for daily code review, but the rule set is still growing:\n\n- **Platform**: Windows, macOS, Linux — single Python codebase, no platform shims.\n- **Performance**: typical analysis runs in **under 100 ms** per snippet.\n- **Rule coverage**: 442 detection rules from the Devaic v2.0 schema, with ~30 of them carrying drop-in safe-replacement remediation. Coverage is expanding release by release.\n- **Languages**: Python only. Other languages may follow based on demand.\n\nIf something doesn't work the way you expect, please [open an issue](https:\u002F\u002Fgithub.com\u002Fredlyne-ai\u002Fredlyne\u002Fissues) — we read everything.\n\n## Known Limitations\n\n- Detection and remediation depend on the bundled rule set; novel or obfuscated patterns may not be flagged.\n- Selections that are too short (a single statement out of context) may not provide enough signal for accurate analysis.\n\n## Contributing\n\nContributions of all sizes are welcome — bug reports, feature ideas, rule submissions, documentation fixes, and code.\n\n- Read [CONTRIBUTING.md](CONTRIBUTING.md) for the development setup and pull request process\n- Read [CODE_OF_CONDUCT.md](CODE_OF_CONDUCT.md) for community expectations\n- Browse [open issues](https:\u002F\u002Fgithub.com\u002Fredlyne-ai\u002Fredlyne\u002Fissues), especially those tagged `good first issue`\n- Join the discussion in [GitHub Discussions](https:\u002F\u002Fgithub.com\u002Fredlyne-ai\u002Fredlyne\u002Fdiscussions)\n\n## Contact\n\n- **General inquiries \u002F partnerships \u002F press:** [info@redlyne.io](mailto:info@redlyne.io)\n- **Bugs and feature requests:** [GitHub Issues](https:\u002F\u002Fgithub.com\u002Fredlyne-ai\u002Fredlyne\u002Fissues)\n- **Questions and ideas:** [GitHub Discussions](https:\u002F\u002Fgithub.com\u002Fredlyne-ai\u002Fredlyne\u002Fdiscussions)\n- **Code of Conduct reports:** [conduct@redlyne.io](mailto:conduct@redlyne.io)\n- **Website:** [redlyne.io](https:\u002F\u002Fredlyne.io)\n\n## License\n\nRedlyne uses a **dual-license** model:\n\n| Component | License |\n|---|---|\n| Source code (extension, scripts, build) | [Apache License 2.0](LICENSE.md) |\n| Detection rules, vulnerability patterns, datasets | [CC BY-NC-SA 4.0](https:\u002F\u002Fcreativecommons.org\u002Flicenses\u002Fby-nc-sa\u002F4.0\u002F) (non-commercial) |\n\nThis separation keeps the engineering side fully open source — fork it, extend it, ship it commercially with attribution — while preserving the value of the curated rule set.\n\nFor commercial licensing of the rules and datasets, partnership, or enterprise inquiries: **[redlyne.io](https:\u002F\u002Fredlyne.io)** · [info@redlyne.io](mailto:info@redlyne.io)\n\nThe names \"Redlyne\" and the Redlyne logo are trademarks. See [NOTICE](NOTICE) for details.\n","Redlyne 是一个 VS Code 扩展，用于检测并修补 AI 生成的 Python 代码中的漏洞。其核心功能包括基于模式的漏洞检测和一键式修复建议，这些功能完全在本地运行，不依赖于任何服务器，确保了代码的安全性和隐私性。技术上，Redlyne 采用了一套由安全专家手工编写的确定性规则引擎，而非使用大语言模型（LLM），从而保证了检测结果的可重复性和可审计性。适用于需要提高 AI 生成代码安全性的开发场景，尤其是在使用如 Copilot、ChatGPT 或 Claude 等 AI 编程助手时。","2026-06-11 04:02:27","CREATED_QUERY"]