AgentWard: 자율 AI 에이전트를 위한 Lifecycle Security 아키텍처
AgentWard: A Lifecycle Security Architecture for Autonomous AI Agents
TL;DR Highlight
AI 에이전트의 초기화부터 실행까지 5단계 전 생애주기에 걸친 보안 레이어를 체계적으로 설계한 방어 아키텍처 제안.
Who Should Read
LLM 기반 자율 에이전트를 프로덕션에 배포하는 백엔드/인프라 개발자. Prompt Injection, 메모리 오염, 악성 플러그인 등 에이전트 보안 위협을 실제로 고민하는 AI 시스템 설계자.
Core Mechanics
- 에이전트 보안 위협은 단일 지점에서 끝나지 않고 초기화 → 입력 → 메모리 → 의사결정 → 실행 순으로 전파됨. 입력 필터링 하나만으로는 막을 수 없음.
- 5개 보호 레이어 구성: Foundation Scan(공급망), Input Sanitization(입력), Cognition Protection(메모리), Decision Alignment(의사결정), Execution Control(실행). 각 레이어가 다른 보안 원칙으로 동작해 공통 우회 패턴을 방지.
- Zero-trust 원칙 적용 - 앞 레이어가 'allow' 판정해도 뒤 레이어가 다시 독립적으로 검증. 업스트림 컴포넌트가 이미 오염됐다고 가정하고 동작.
- Cross-layer 조율(Cross-layer Coordination): 한 레이어에서 '애매하다'고 판정된 신호를 다음 레이어로 전달해 누적 리스크 판정. 약한 신호들이 쌓이면 더 엄격한 실행 정책 자동 적용.
- 악성 스킬(skill) 시나리오: Foundation Scan이 스킬 설명과 실제 코드 간 불일치를 감지 → Decision Alignment에서 비인가 계획 탐지 → Execution Control에서 파일 접근 차단. 3개 레이어 연동 예시.
- Indirect Prompt Injection → 메모리 백도어 시나리오: 웹페이지에서 주입된 악성 명령이 MEMORY.md에 저장되려 할 때 Cognition Protection이 차단. 메모리가 미래 세션의 공격 중계 포인트가 되는 것을 방지.
Evidence
- OpenClaw 에이전트 위에 플러그인 네이티브 프로토타입을 구현해 2개의 멀티스테이지 공격 체인(악성 스킬 → 데이터 유출, Indirect Prompt Injection → 지속적 백도어 + DoS)에서 레이어 간 협력으로 공격 차단을 실증.
- Foundation Scan은 before_prompt_build 훅에, Input Sanitization과 Decision Alignment는 before_message_write 훅에, Cognition Protection과 Execution Control은 before_tool_call 훅에 각각 부착 - 구체적 구현 포인트 제시.
- Execution Control에 eBPF 기반 시스템 모니터, 최소 권한(least-privilege) 집행, 상태 롤백, 트래픽 모니터링을 조합해 런타임 환경 측 최종 방어선 구성.
How to Apply
- 자체 에이전트 시스템의 런타임 이벤트를 5단계(초기화/입력/메모리/결정/실행)로 분류하고, 각 단계에 독립적인 검증 훅을 추가하라. 예를 들어 tool_call 직전에 명령 패턴 검사 레이어를 끼워넣는 것부터 시작.
- 에이전트가 외부 문서나 웹 검색 결과를 메모리(파일/DB)에 저장하는 경우, 저장 직전에 Prompt Injection 패턴 및 콘텐츠 이상 여부를 검사하는 Cognition Protection 레이어를 추가해 백도어 지속화를 방지.
- 보안 판정 결과를 세션 공유 상태(shared security state)로 유지해 다음 레이어로 전달하라. 한 레이어에서 '의심스럽지만 차단 불가' 판정이 나면 이를 플래그로 저장하고, 이후 고위험 액션 발생 시 더 엄격한 정책 적용하는 누적 에스컬레이션 패턴을 구현.
Code Example
# OpenClaw 플러그인 스타일 - AgentWard 레이어 훅 부착 예시
class AgentWardPlugin:
def __init__(self):
self.session_risk_state = {"risk_score": 0, "warnings": []}
# Foundation Scan: 스킬 로드 전 검사
def before_prompt_build(self, context):
for skill in context.loaded_skills:
if self._detect_skill_mismatch(skill):
self.session_risk_state["warnings"].append({
"layer": "foundation_scan",
"skill": skill.name,
"finding": "description_code_mismatch"
})
self.session_risk_state["risk_score"] += 30
# Input Sanitization: 외부 콘텐츠 입력 시 검사
def before_message_write(self, message):
if message.role == "tool":
if self._detect_prompt_injection(message.content):
message.content = self._sanitize(message.content)
self.session_risk_state["risk_score"] += 20
self.session_risk_state["warnings"].append({
"layer": "input_sanitization",
"action": "sanitized"
})
# Cognition Protection: 메모리 파일 수정 시 검사
# Execution Control: 모든 tool call 감시
def before_tool_call(self, tool_name, params, is_memory_write=False):
if is_memory_write:
# Cognition Protection
if self._detect_malicious_memory_pattern(params):
return {"block": True, "reason": "suspicious_memory_mutation"}
# Execution Control: 누적 리스크 기반 정책 강화
if self.session_risk_state["risk_score"] > 40:
if self._is_high_risk_command(tool_name, params):
return {"block": True, "reason": "high_risk_under_elevated_session_risk"}
return {"block": False}
def _detect_skill_mismatch(self, skill): ...
def _detect_prompt_injection(self, content): ...
def _sanitize(self, content): ...
def _detect_malicious_memory_pattern(self, params): ...
def _is_high_risk_command(self, tool_name, params): ...Terminology
관련 논문
adamsreview: Claude Code용 멀티 에이전트 PR 코드 리뷰 파이프라인
Claude Code에서 최대 7개의 병렬 서브 에이전트가 각각 다른 관점으로 PR을 리뷰하고, 자동 수정까지 해주는 오픈소스 플러그인이다. 기존 /review나 CodeRabbit보다 실제 버그를 더 많이 잡는다고 주장하지만 커뮤니티에서는 복잡도와 실효성에 대한 회의론도 나왔다.
Claude를 User Space IP Stack으로 써서 Ping에 응답시키면 얼마나 빠를까?
Claude Code에게 IP 패킷을 직접 파싱하고 ICMP echo reply를 구성하도록 시켜서 실제로 ping에 응답하게 만든 실험으로, 'Markdown이 곧 코드이고 LLM이 프로세서'라는 아이디어를 네트워크 스택 수준까지 밀어붙인 재미있는 사례다.
AI Agent를 위한 Git: re_gent
AI 코딩 에이전트(Claude Code 등)가 수행한 모든 툴 호출을 자동으로 추적하고, 어떤 프롬프트가 어느 코드 줄을 작성했는지 blame까지 가능한 버전 관리 도구다.
Agent-Native CLI를 위한 설계 원칙 10가지
AI 에이전트가 CLI 도구를 더 잘 사용할 수 있도록 설계하는 원칙들을 정리한 글로, 에이전트가 CLI를 도구로 활용하는 빈도가 높아지면서 이 설계 방식이 실용적으로 중요해지고 있다.
Agent-harness-kit: MCP 기반 멀티 에이전트 워크플로우 오케스트레이션 프레임워크
여러 AI 에이전트가 서로 역할을 나눠 협업할 수 있도록 조율하는 scaffolding 도구로, Vite처럼 설정 없이 빠르게 멀티 에이전트 파이프라인을 구성할 수 있다.
Tilde.run – AI Agent를 위한 트랜잭션 기반 버전 관리 파일시스템 샌드박스
AI 에이전트가 실제 프로덕션 데이터를 건드려도 롤백할 수 있는 격리된 샌드박스 환경을 제공하는 도구로, GitHub/S3/Google Drive를 하나의 버전 관리 파일시스템으로 묶어준다.
Related Resources
Original Abstract (Expand)
Autonomous AI agents extend large language models into full runtime systems that load skills, ingest external content, maintain memory, plan multi-step actions, and invoke privileged tools. In such systems, security failures rarely remain confined to a single interface; instead, they can propagate across initialization, input processing, memory, decision-making, and execution, often becoming apparent only when harmful effects materialize in the environment. This paper presents AgentWard, a lifecycle-oriented, defense-in-depth architecture that systematically organizes protection across these five stages. AgentWard integrates stage-specific, heterogeneous controls with cross-layer coordination, enabling threats to be intercepted along their propagation paths while safeguarding critical assets. We detail the design rationale and architecture of five coordinated protection layers, and implement a plugin-native prototype on OpenClaw to demonstrate practical feasibility. This perspective provides a concrete blueprint for structuring runtime security controls, managing trust propagation, and enforcing execution containment in autonomous AI agents. Our code is available at https://github.com/FIND-Lab/AgentWard .