"매 source code 의 author 를 statistical fingerprint 로 식별 — 그리고 attacker 는 이를 회피한다.". Code stylometry 는 AST features + n-grams + lexical patterns 로 author 를 95% accuracy 로 deanonymize 가능; adversarial stylometry 는 transformation/obfuscation 으로 이를 무력화한다.
importanthropicclient=anthropic.Anthropic()defneutralize_style(code:str)->str:msg=client.messages.create(model="claude-opus-4-7",max_tokens=4096,messages=[{"role":"user","content":f"""Rewrite this code to neutralize authorial style.
Preserve semantics exactly. Use generic identifiers, standard idioms, mechanical formatting.
```python
{code}```"""}],)returnmsg.content[0].text
Mimicry Attack (target style)
defmimic(code:str,target_samples:list[str])->str:"""Rewrite `code` to look like `target_samples` author."""target_blob="\n---\n".join(target_samples[:3])prompt=f"Target author samples:\n{target_blob}\n\nRewrite preserving semantics:\n{code}"returnllm_call(prompt)