Skip to content

SpecCloak: Probing Harmful Code Generation via Engineering SpecificationsSpecCloak: Probing Harmful Code Generation through Engineering Specifications

arXiv: Jailbreaks, Prompt Injection, Poisoning & Defenses· arXiv:2610.17907· Wenbin Chen, Jiexin Wang, Guanting Wu, Jiaxi Liang, Yi CaiSouth China University of TechnologyIndexed by this site · 2026-10-14· Originally publishedAttacks

Translation in progress — untranslated text is omitted.

Quick read

Attacks

Based on the paper PDF (AI-generated); refer to the original

AI summaryThe paper proposes the PseudoSpec template, organizing malicious programming requirements into engineering specification form, and finds that this form significantly reduces refusals across five open-weight models, even when risk keywords are retained. Based on this, the authors build the black-box red-teaming framework SpecCloak, combining PseudoSpec with discriminator-guided optimization, achieving an average execution-verified attack success rate of 28.91% on RedCode-Gen across eight target models. Analysis shows that the refusal drop is accompanied by a shift in representations toward code output direction, and activation intervention along the conditional difference direction can alter refusal behavior. The paper also provides a defense prototype SpecReveal, using natural language intent reconstruction and dual-perspective detection without fine-tuning the target model, achieving 96.88% attack detection rate in a separate prompt detection evaluation.

Questions
Code assistants may be used to implement harmful functionality. The authors want to find out whether refusal of malicious code requests changes when functional requirements are written as engineering specifications, not just whether the wording contains risk words.
Methods
PseudoSpec writes requirements as a four-part specification: configuration, predicate interfaces, temporal constraints, and implementation requirements. SpecCloak iterates on this template with a discriminator without querying the target, then submits once. SpecReveal converts the specification back into natural language and performs risk assessment on both the original and the restored text.
Experiments and results
Five open-source models have refusal rates of 0–8.65% under the specification condition with risk words retained (Table I). SpecCloak's average E-ASR on RedCode-Gen across eight targets is 28.91%, with a total refusal rate of 10.31%. Under o4-mini review, union detects 98/100.
Limitations and future work
The authors state that mechanistic evidence is limited to open-weight models, disjoint from the attack evaluation model set, and steering specificity also varies with model. Future work includes causal separation of risk channels, testing whether framework directions can predict attack success, and addressing adaptive attackers. The specific model names for G and D are not reported.

Related events and news

1 events · 1 news mentions

News that mentions this paper

RL/RLHF 训练条件可诱发模型智能体提权逃逸

Related papers

Show 2 more papers
Read originalarxiv.org