Pith. sign in

REVIEW 5 cited by

DeceptPrompt: Exploiting LLM-driven Code Generation via Adversarial Natural Language Instructions

Not yet reviewed by Pith; the record is open.

This paper has not been read by Pith yet. Machine review is queued; the pith claim, tier, and objections will appear here once it completes.

SPECIMEN: schema-true, not a live event

T0 review · schema-true

One-sentence machine reading of the paper's core claim.

pith:XXXXXXXX · record.json · timestamp

arxiv 2312.04730 v2 pith:ARPAN3BO submitted 2023-12-07 cs.CR cs.AI

classification cs.CRcs.AI
keywords codellmsdeceptpromptlanguagenaturalgenerategenerationpractical
verification ladder T0 review T1 audit T2 compute T3 formal
0 comments
read the original abstract

With the advancement of Large Language Models (LLMs), significant progress has been made in code generation, enabling LLMs to transform natural language into programming code. These Code LLMs have been widely accepted by massive users and organizations. However, a dangerous nature is hidden in the code, which is the existence of fatal vulnerabilities. While some LLM providers have attempted to address these issues by aligning with human guidance, these efforts fall short of making Code LLMs practical and robust. Without a deep understanding of the performance of the LLMs under the practical worst cases, it would be concerning to apply them to various real-world applications. In this paper, we answer the critical issue: Are existing Code LLMs immune to generating vulnerable code? If not, what is the possible maximum severity of this issue in practical deployment scenarios? In this paper, we introduce DeceptPrompt, a novel algorithm that can generate adversarial natural language instructions that drive the Code LLMs to generate functionality correct code with vulnerabilities. DeceptPrompt is achieved through a systematic evolution-based algorithm with a fine grain loss design. The unique advantage of DeceptPrompt enables us to find natural prefix/suffix with totally benign and non-directional semantic meaning, meanwhile, having great power in inducing the Code LLMs to generate vulnerable code. This feature can enable us to conduct the almost-worstcase red-teaming on these LLMs in a real scenario, where users are using natural language. Our extensive experiments and analyses on DeceptPrompt not only validate the effectiveness of our approach but also shed light on the huge weakness of LLMs in the code generation task. When applying the optimized prefix/suffix, the attack success rate (ASR) will improve by average 50% compared with no prefix/suffix applying.

Discussion (0). Continue with ORCID to comment.

Forward citations

Cited by 5 Pith papers

Reviewed papers in the Pith corpus that reference this work. Sorted by Pith novelty score. Full citation record

  1. MOCHA: Are Code Language Models Robust Against Multi-Turn Malicious Coding Prompts?

    cs.CL 2025-07 conditional novelty 7.0 of 10

    MOCHA is a benchmark of 10.5K malicious coding prompts, including multi-turn decomposition attacks, showing code LLMs reject these incremental attacks at much lower rates and that fine-tuning on the benchmark improves...

  2. IssueTrojanBench: Benchmarking AI Coding Agents Against Malicious Issue Requests

    cs.CR 2026-07 conditional novelty 6.0 of 10

    AI coding agents followed malicious instructions embedded in issue-style artifacts in 66.5% of 4,176 test runs.

  3. When Prompts Go Wrong: Evaluating Code Model Robustness to Ambiguous, Contradictory, and Incomplete Task Descriptions

    cs.SE 2025-07 conditional novelty 6.0 of 10

    Code-generating LLMs lose 20 to 40 percentage points in pass rate when task descriptions are ambiguous, incomplete, or contradictory.

  4. RedCoder: Automated Multi-Turn Red Teaming for Code LLMs

    cs.SE 2025-06 conditional novelty 6.0 of 10

    A multi-turn red-teaming agent trained on simulated attacker-defender conversations induces vulnerable code at higher rates than prior attack methods across several code LLMs.

  5. Chain-of-Code Collapse: Reasoning Failures in LLMs via Adversarial Prompting in Code Generation

    cs.CL 2025-06 reject novelty 4.0 of 10

    Prompt rewrites of LeetCode problems cause large accuracy swings in nine LLMs, but invalid negation test cases and inconsistent tables make the headline numbers unreliable.

Pith tools