Attention을 활용한 악성 Agent Skill 탐지: Locate-and-Judge
Detecting Malicious Agent Skills in the Wild using Attention
TL;DR Highlight
LLM 에이전트 마켓플레이스에 퍼진 악성 Skill 파일을 Attention 기반으로 저렴하게 탐지하는 2단계 파이프라인
Who Should Read
LLM 에이전트 시스템에 외부 Skill/플러그인 마켓플레이스를 연동하는 개발자나 보안 엔지니어. 프롬프트 인젝션 방어를 구현하거나 에이전트 공급망 보안을 고민하는 사람.
Core Mechanics
- LLM 에이전트가 로드하는 'Skill'(SKILL.md 파일 형태의 자연어 명령 패키지)은 기존 프롬프트 인젝션 방어가 통하지 않음. 신뢰/비신뢰 경계 자체가 없기 때문.
- Locate-and-Judge는 2단계로 동작함. 먼저 작은 LLM(Qwen2.5-0.5B-Instruct)이 Skill 전체를 읽고 Attention이 높은 상위 K개 span만 추출(Locator), 그 span만 DeepSeek-V4-Flash 판사(Judge)에게 넘겨 악성 여부 판단.
- Locator는 'Attention이 높은 span = 모델이 실제로 따를 명령'이라는 가설을 기반으로 함. 악성 인젝션은 실행되려면 반드시 높은 Attention을 끌어야 한다는 원리.
- 134k개 Skill을 스캔하는 데 약 $34(약 5만원)만 들었음. 전체 내용 스캔 대비 2.84배 적은 토큰 사용.
- Hidden Malicious Skills(HMS, 정상 기능으로 위장한 악성 Skill)를 83% 탐지. 기존 전체 내용 스캔 방식은 같은 클래스에서 45%에 불과.
- Lobehub, Skills.sh, Clawhub.ai 3개 마켓플레이스에서 131개 악성 Skill 확인, 그 중 82개는 정상 도구로 위장한 HMS였고 SkillSpector·Cisco Skill Scanner가 못 잡은 것들이 다수.
Evidence
- 134,934개 Skill 스캔 결과 359개 플래그 → 131개 악성 확인, precision 83.3%. 공격 도구 포함 시 89%.
- Locate-and-Judge F1=0.925, SkillSpector recall 20%(F1 크게 하락), Cisco Skill Scanner recall 15.4%(McNemar p<0.001로 통계적 유의미한 차이).
- HMS(위장형 악성) 탐지율: Locate-and-Judge 83% vs 전체 내용 스캔 45%. 특히 자격증명 탈취 Skill에서 89% vs 37%.
- K=3 설정 시 F1=0.955로 최고 성능, 전체 내용 스캔(F1=0.921, 토큰 799개/Skill) 대비 더 높은 정확도로 토큰 397개/Skill만 사용.
How to Apply
- 에이전트 마켓플레이스나 Skill 저장소에 업로드 시점 검증 파이프라인을 만드는 경우: Qwen2.5-0.5B 같은 작은 LLM으로 Skill 파일의 Attention을 읽어 상위 K개 span을 추출하고, 해당 span만 GPT-4급 모델에게 악성 여부 판단을 맡기면 전체 스캔 대비 비용을 2~3배 절감할 수 있음.
- 현재 regex/키워드 기반 Skill 스캐너를 쓰는 경우: 키워드 없이 위장한 HMS는 regex로 잡을 수 없으므로, Attention 기반 Locator를 앞단에 두고 의심 span을 추려 LLM 판단을 붙이는 하이브리드 구조로 바꾸면 탐지율이 크게 올라감.
- base64 인코딩된 악성 one-liner가 걱정된다면: 현재 구조에서 유일한 blind spot이 이 패턴임. Span segmenter가 이를 독립 span으로 분리하지 못하는 경우가 있으므로, 플래그된 Skill에 한해 전체 내용 2차 스캔을 추가하는 fallback을 두면 됨.
Code Example
Terminology
관련 논문
Self-Compacting Language Model Agents: Rubric 기반 적응형 Context 압축
LLM 에이전트가 스스로 '지금 요약해도 되는지'를 판단하는 rubric을 추가하면, 파인튜닝 없이도 고정 주기 요약보다 정확도는 높고 비용은 30~70% 낮아진다.
Oak – AI 에이전트를 위해 설계된 Git 대안 VCS
AI 에이전트가 코드 작업을 더 효율적으로 수행할 수 있도록 설계된 새로운 버전 관리 시스템(VCS)으로, lazy mount, JSON-first CLI, 멀티 레포 에이전트 워크스페이스 등을 제공한다. 다만 커뮤니티에서는 Git 대비 실질적 우위가 충분히 증명되지 않았다는 회의적 반응이 많다.
Recall — Claude Code를 위한 완전 로컬 프로젝트 메모리 도구
Claude Code 세션이 끝날 때마다 프로젝트 컨텍스트를 처음부터 다시 설명해야 하는 문제를 외부 API 없이 로컬에서 해결하는 Python 기반 오픈소스 도구다.
Show HN: 거절 대신 펜 테스트를 수행하도록 post-training한 모델
Kimi K2.6 모델을 post-training해서 보안 거부 응답 없이 실제 취약점 스캔과 펜 테스트를 수행하는 CLI 도구 ArgusRed를 공개했다. 오픈 모델을 조금만 조정하면 AI 기반 해킹 도구를 누구나 만들 수 있다는 점에서 보안 커뮤니티에 논란이 되고 있다.
LedgerAgent: Policy를 준수하는 Tool-Calling 에이전트를 위한 구조화된 State 관리
고객서비스 AI 에이전트가 정책을 위반하는 tool call을 실행 전에 차단하는 '원장(Ledger)' 기반 상태 관리 방법론
Sovereign Execution Broker: AI 에이전트의 클라우드 인프라 변경을 Certificate로 강제 통제하는 런타임 경계
LLM 에이전트가 AWS/K8s를 직접 건드리지 못하게, 모든 인프라 변경을 암호화 인증서로 묶어 중간 브로커가 강제 검증하는 보안 아키텍처.
Related Resources
Original Abstract (Expand)
LLM agents increasingly load skills, file-based packages of natural-language instructions written by third parties and distributed through marketplaces, that execute with the user's privileges. A single malicious skill can exfiltrate data, hijack the agent, or persist as a supply-chain foothold, which turns the skill marketplace into a new attack surface for agentic systems. Prompt-injection defenses do not carry over to this setting. They rely on a boundary between trusted instructions and untrusted data, whereas a skill is itself a body of instructions, so an injected command sits among many legitimate ones and inherits their authority. We present Locate-and-Judge, a two-stage detector designed for this regime. A lightweight locator scores the structural spans of a skill by the instruction-following attention each span draws and retains only the top-K. A judge then examines the retained spans in detail. Concentrating the costly judgment on a few high-attention spans lets the detector audit an entire marketplace instead of a sample. Compared to direct LLM-based scanning, this approach offers an order-of-magnitude cost reduction, dramatically increasing its scalability at a small cost to recall, and it dominates keyword and regex baselines at comparable expense. Deployed at marketplace scale and at negligible cost, Locate-and-Judge flags skills with high precision, the majority of which we manually confirmed as malicious, surfacing dozens of live malicious skills, including several disguised as benign functionality and many that SkillSpector and Cisco Skill Scanner fail to detect. We release the resulting labeled dataset.