ResearchResearch paperSafety & Alignment1 source · Oct 13, 2026

SpecCloak: Probing Harmful Code Generation through Engineering Specifications

We introduce PseudoSpec, a template that organizes functional requirements as engineering specifications, and investigate its effects through controlled comparisons, representation analysis, and activation interventions.

Key points

  • The code generation capabilities of large language models (LLMs) can equally be misused to implement harmful functionality, underscoring the need to understand their safety behavior in response to programming requests.
  • While request phrasing is known to influence refusal, it remains unclear whether the form in which coding task requirements are stated affects the refusal process for malicious code generation.
  • Building on these findings, we propose SpecCloak, a black-box red-teaming framework combining PseudoSpec with discriminator-guided optimization, achieving an average execution-verified attack success rate of 28.91% across eight target models on RedCode-Gen.
  • We also introduce SpecReveal, a defense prototype combining natural-language intent reconstruction with dual-view detection without target-model fine-tuning.

Sources (1)

  • [1]SpecCloak: Probing Harmful Code Generation through Engineering Specifications
    arXiv (AI, ML, NLP, CV, robotics, multi-agent) · Oct 13, 07:59 AM
    We introduce PseudoSpec, a template that organizes functional requirements as engineering specifications, and investigate its effects through controlled comparisons, representation analysis, and activation interventions.
    The code generation capabilities of large language models (LLMs) can equally be misused to implement harmful functionality, underscoring the need to understand their safety behavior in response to programming requests.

Extractive summary: sentences quoted from the sources.

Before this

  1. Oct 13, 2026Risk-Averse Inference-Time Diffusion Model Alignment with Finite-Sample Guarantees
  2. Oct 13, 2026Towards Green AI: Evaluating Energy Efficiency for Quantized LLM Inference
  3. Oct 12, 2026unslothai/unsloth v0.1.906-beta: Browser Use + Qwen-Image-2.1-Turbo
  4. Oct 12, 2026Rethinking LLM-Guided Visual Question Answering: Does Deeper Knowledge Integration Really Help?
  5. Oct 12, 2026Omni-Modal LLMs Know More Than They Say
  6. Oct 11, 2026GA-SVD: Generation-aware Singular Value Decomposition for LLM Compression

Related