← 返回列表

AIxCC状元Atlantis技术探秘

聚合站 SecWiki技术 作者 大山子雪人 发布 2025年8月26日 09:40 入库 2026-11-18T03:45:50

Atlanta团队

团队负责人是Taesoo Kim,下面6个子团队,每个团队分别负责一个方向。

• Atlantis-Multilang: 有11位成员

• Atlantis-C: 有6位成员

• Atlantis-Java: 有9位成员

• Atlantis-Patch: 有13位成员,主要负责自动化补丁生成与验证(程序修复)

• Atlantis-SARIF: 有6位成员,主要负责SARIF 评估(assessment)与相关报告提交

• Atlantis-Infra: 有5位成员,主要负责整套 CRS 的“基础设施与编排”

CRS架构图


Design Overview of Atlantis


Design of Patching Agents

Agent分类及其关系

  1. MartianAgent

example-crs-webservice/crs-patch/packages/crete/framework/agent/services/martian根据预设的工作流,自动定位、分析并修复代码中的安全缺陷。支持与用户或系统进行多轮交互


Martian agent

漏洞定位用了o4-mini模型,报告解析用了gpt-4o模型,代码生成用了claude-sonnet-4-20250514模型,用gemini-2.5-pro做为backup。

  1. MultiRetrievalPatchAgent

example-crs-webservice/crs-patch/packages/crete/framework/agent/services/multi_retrieval

以“多策略代码检索+补丁生成”为核心,强调多种检索手段(如正则、AST、语义等)和灵活的信息获取,适合需要复杂信息检索、上下文理解和多轮推理的补丁生成场景。更注重检索与推理的灵活组合。


MultiRetrievalPatchAgent

  1. PrismAgent

example-crs-webservice/crs-patch/packages/crete/framework/agent/services/prism

实现自动化的安全补丁生成与验证,聚焦于多轮推理、反馈驱动和高效修复流程。

•自动化补丁生成能根据漏洞定位结果,自动生成候选补丁,并结合多轮推理优化补丁质量。

•反馈驱动的修复流程支持补丁验证、回归测试和反馈收集,根据反馈动态调整修复策略,实现闭环优化。

•多轮推理与决策结合大模型能力,支持多轮交互式推理,提升复杂场景下的修复成功率。

•模块化与可扩展性采用模块化设计,便于集成不同的漏洞定位、补丁生成和验证组件。

•适配多种安全场景可用于多种类型的安全漏洞修复任务,支持不同语言和项目的自动化修复。


prism agent

4.VincentAgent

example-crs-webservice/crs-patch/packages/crete/framework/agent/services/vincent

基于 sanitizer 报告和 PoC(漏洞利用样例)信息,自动分析并修复安全漏洞。Vincent agent 采用 Langchain 框架实现,集成了代码搜索(ctags、tree-sitter)、多节点分析、LLM 交互等能力,适合自动化、高质量的安全补丁生成场景。


VincentAgent

5.ClaudeLikeAgent

example-crs-webservice/crs-patch/packages/crete/framework/agent/services/claude_like

ClaudeLikeAgent 是一个以 ReAct 智能体为核心、集成多工具和多轮反馈的自动化补丁生成 agent

•自动化补丁生成基于崩溃日志或 SARIF 报告自动生成修复补丁(patch diff)。

•ReAct 智能体架构采用 ReAct agent(结合推理与行动),通过 ClaudeLike coder 进行多步推理和代码修改。

•多工具协作集成多种文件编辑工具(如增删改查、内容查看等),并可通过 AgentTool 动态派生子 agent 处理复杂任务,提升效率和上下文利用率。

•多轮反馈与优化支持根据反馈自动调整和优化补丁,直到生成合理的修复方案。

•高效上下文管理通过分步处理和子 agent 派发,减少主 agent 的上下文压力,适合大规模代码修复场景。


claudelike agent

6.EraserAgent

example-crs-webservice/crs-patch/packages/crete/framework/agent/services/eraser

EraserAgent 是一个以自动化、策略驱动和 LLM 结合为核心的安全补丁生成与验证智能体,适合自动化漏洞修复和补丁生成场景。

•自动化安全补丁生成与应用根据崩溃日志和检测结果,自动分析漏洞、生成补丁,并将补丁应用到源码中。

•多步交互与策略优化通过环境模拟和多步策略(EraserPolicy),结合 LLM 能力和多种工具,逐步探索和优化修复方案。

•补丁验证与评估生成补丁后自动进行差异(diff)检测和效果评估,确保补丁有效且无副作用。

•高可扩展性支持自定义工具链、模式和 LLM 后端,适应不同类型的安全修复任务。


eraser agent

以上不同agent虽然实现目的相同,但是策略各有不同。


agent_comparison

Agent深入分析

1.MartianAgent

前面提到MartianAgent是根据预设的工作流,自动定位、分析并修复代码中的安全缺陷的。

agents=[MartianAgent(fault_localization_llm=LlmApiManager.from_environment(model="o4-mini", custom_llm_provider="openai"),report_parser_llm=LlmApiManager.from_environment(model="gpt-4o", custom_llm_provider="openai"),code_generation_llm=LlmApiManager.from_environment(model="claude-sonnet-4-20250514", custom_llm_provider="anthropic"),backup_llm=LlmApiManager.from_environment(model="gemini-2.5-pro",custom_llm_provider="openai",),max_iterations=5,),],workflow = Workflow(self._fault_localization_llm,self._report_parser_llm,self._code_generation_llm,self._max_iterations,output_directory,self._backup_llm,)根据crash报告,结合源码审计,定位漏洞位置。

messages = [SystemMessage("""Your task is to analyze the bug and provide a patch plan to fix the bug in the codebase.I will give you the crash log and additional information to help you analyze the bug.Note that the location of the bug is DIFFERENT from the crash location.The crash location is where the program crashes, but the bug location is where the bug is introduced.You'll have to get enough code context to understand the bug.Fully utilize the given code inspection tools to find the bug location."""),HumanMessage("""Generate a bug analysis report.The report should contain the bug location and the patch plan to fix the bug.- What is the root cause of the bug?- What part of the codebase could be responsible for the bug?- What is the correct patch to fix the bug?- What is the side effect of the patch?## FORMATFor each bug location, you should provide the file path, function name in below format:File Path: path/to/file.cFunction Name: function_name## Rules- Fully utilize the given code inspection tools to get the code context.- Don't assume any functions or macros that you did not see in the code. Call the tools to make sure.- Don't ask to get confirmation. Proceed with your best guess.- Don't pinpoint bug location in the fuzz harness or test cases.{guidance_section}{crash_log_section}{sarif_report_section}{delta_mode_ref_diff_section}""".format(guidance_section=_make_guidance_section(detection),crash_log_section=_make_crash_log_section(context, detection),sarif_report_section=_make_sarif_report_section(context, detection),delta_mode_ref_diff_section=_make_delta_mode_ref_diff_section(context, detection),).strip()),]2. MultiRetrievalPatchAgent

example-crs-webservice/crs-patch/packages/crete/framework/agent/services/multi_retrieval/nodes/patchers/system_guided_patcher.py

在SystemGuidedPatcher的system prompt设计中,明确要求“每次交互都要先分析、再探索、再检索代码,最后才允许生成 patch”。检索方式包括:grep 查询(函数名、类名、变量名等)、file 查询(指定文件及行号),每轮检索需至少3条,最多5条,且优先用 grep,必要时用 file。

3.PrismAgent

PrismAgent 以“多团队协作+状态机工作流”为核心,自动驱动分析-补丁-评测多轮闭环,具备高可扩展性和健壮性。其代码结构清晰,便于插拔和调试,是典型的工程化多智能体自动修复方案。

defcompile(self, llm: ChatLiteLLM) ->None:self.supervisor = Supervisor(max_n_evals=self.max_n_evals)self.analysis_team = AnalysisTeam(llm=llm)self.evaluation_team = EvaluationTeam(llm=llm)self.patch_team = PatchTeam(llm=llm)self.graph_builder.add_node("supervisor",self.supervisor)# type: ignoreself.graph_builder.add_node("analysis_team",self.analysis_team.compiled_graph)# type: ignoreself.graph_builder.add_node(# type: ignore"evaluation_team",self.evaluation_team.compiled_graph)self.graph_builder.add_node("patch_team",self.patch_team.compiled_graph)# type: ignoreself.graph_builder.add_edge(START,"supervisor")self.graph_builder.add_edge("analysis_team","supervisor")self.graph_builder.add_edge("evaluation_team","supervisor")self.graph_builder.add_edge("patch_team","supervisor")self.graph_builder.add_conditional_edges("supervisor",self.supervisor.route)self._compiled_graph =self.graph_builder.compile()# type: ignore四大team包括:supervisor,analysis_team, evaluation_team, patch_teamSupervisor 负责根据当前状态(team_status)、评测次数、补丁状态等,动态路由到下一个团队节点,实现多轮分析-补丁-评测的闭环。AnalysisTeam,PatchTeam,EvaluationTeam 分别负责漏洞分析、补丁生成、补丁评测。

•AnalysisTeam

classAnalysisTeam(BaseTeam):def__init__(self, llm: BaseChatModel, max_n_fix_strategy_tries:int=3) ->None:super().init(llm)self.max_n_fix_strategy_tries = max_n_fix_strategy_triesself.code_context_provider = CodeContextProvider(llm)self.fix_strategy_generator = FixStrategyGenerator(llm)defcompile(self) ->None:#TODO:Add multi turn analysis with routingself.graph_builder.add_node(# type: ignore"fix_strategy_generator",self.fix_strategy_generator)self.graph_builder.add_node("code_context_provider",self.code_context_provider)# type: ignoreself.graph_builder.add_edge(START,"code_context_provider")self.graph_builder.add_edge("code_context_provider","fix_strategy_generator")self.graph_builder.add_conditional_edges("fix_strategy_generator",self.route_fix_strategy_generator)self._compiled_graph =self.graph_builder.compile()# type: ignore•PatchTeam

classPatchTeam(BaseTeam):def__init__(self, llm: BaseChatModel, max_n_reviews:int=3) ->None:super().init(llm)self.max_n_reviews = max_n_reviewsself.patch_generator = PatchGenerator(llm)self.patch_reviewer = PatchReviewer(llm)self.graph_builder = StateGraph(PatchTeamState)self.compile()defcompile(self) ->None:self.graph_builder.add_node("patch_generator",self.patch_generator)# type: ignoreself.graph_builder.add_node("patch_reviewer",self.patch_reviewer)# type: ignoreself.graph_builder.add_edge(START,"patch_generator")self.graph_builder.add_conditional_edges("patch_generator",self.route_generator)self.graph_builder.add_conditional_edges("patch_reviewer",self.route_reviewer)self._compiled_graph =self.graph_builder.compile()# type: ignorePatchTeam 通过 StateGraph 构建“生成-评审”循环状态机,包含两个主要节点:patch_generator(负责根据分析报告和评测报告,调用 LLM 生成patch)和tch_reviewer(负责自动评审补丁,判断是否通过)。

4.VincentAgent

classVincentWorkflow:def__init__(self,) ->None:super().init()self._compiled_graph: CompiledStateGraph |None=None@propertydefcompiled_graph(self) -> CompiledStateGraph:ifself._compiled_graphisNone:raiseValueError("Workflow is not compiled. Please call compile() first.")returnself._compiled_graphdefcompile(# pylint: disable=arguments-differself,llm_api_manager: LlmApiManager,) ->None:self.init_analyzer = InitAnalyzer(llm_api_manager=llm_api_manager)self.root_cause_analyzer = RootCauseAnalyzer(llm_api_manager=llm_api_manager)self.property_analyzer = PropertyAnalyzer(llm_api_manager=llm_api_manager)self.request_handler = RequestHandler(llm_api_manager=llm_api_manager)self.patcher = Patcher(llm_api_manager=llm_api_manager)self.compile_feedback = CompileFeedbackPatcher(llm_api_manager=llm_api_manager)self.vulnerable_feedback = VulnerableFeedbackPatcher(llm_api_manager=llm_api_manager)self.test_feedback = TestFeedbackPatcher(llm_api_manager=llm_api_manager)graph_builder = StateGraph(PatchState)# type: ignoregraph_builder.add_node("init_analyzer",self.init_analyzer)# type: ignoregraph_builder.add_node("root_cause_analyzer",self.root_cause_analyzer)# type: ignoregraph_builder.add_node("property_analyzer",self.property_analyzer)# type: ignoregraph_builder.add_node("patcher",self.patcher)# type: ignoregraph_builder.add_node("compile_feedback",self.compile_feedback)# type: ignoregraph_builder.add_node("vulnerable_feedback",self.vulnerable_feedback)# type: ignoregraph_builder.add_node("test_feedback",self.test_feedback)# type: ignoregraph_builder.add_node("request_handler",self.request_handler)# type: ignoregraph_builder.add_edge(START,"init_analyzer")graph_builder.add_edge("init_analyzer","root_cause_analyzer")graph_builder.add_conditional_edges("root_cause_analyzer", route_root_cause_analyzer)graph_builder.add_conditional_edges("property_analyzer", route_property_analyzer)graph_builder.add_conditional_edges("patcher", route_patcher)graph_builder.add_conditional_edges("compile_feedback", route_compile_feedback_patcher)graph_builder.add_conditional_edges("vulnerable_feedback", route_vulnerable_feedback_patcher)graph_builder.add_conditional_edges("test_feedback", route_test_feedback_patcher)graph_builder.add_conditional_edges("request_handler", route_request_handler)self._compiled_graph = graph_builder.compile()# type: ignore每个节点均可根据状态条件路由到下一个节点,实现多轮分析-生成-反馈-再生成的闭环。并且可以看到使用了tree_sitter作为代码解析工具

class VincentCodeInspector:def init(self, proj_path: Path, cache_dir: Path, lang: Language):self.proj_path = proj_pathself.cache_dir = cache_dirself.lang: Language = langself.inspectors: dict[Path, CppInspector | JavaInspector] = {}self.snippet_hashes: set[int] = set()if not self.proj_path.exists():raise FileNotFoundError(f"Project path '{self.proj_path}' not found")if not os.path.exists(self.cache_dir):os.mkdir(self.cache_dir)self.ctags_parser = CtagsParser(self.proj_path, self.cache_dir / "tags", lang)self.parser = Parser()match self.lang:case "c" | "cpp" | "c++":self.parser.language = get_language("c")case "jvm":self.parser.language = get_language("java")5.ClaudeLikeAgent

通过 _iterate_with_output_directory 生成多轮上下文(支持每轮输出归档)。每轮构造ClaudeLikeCoder,动态拼接失败补丁内容,调用claude生成补丁 diff。自动评测 diff,如果评测结果属于失败类型(如VulnerableDiffAction,CompilableDiffAction,UncompilableDiffAction,WrongDiffAction),则将本轮 diff 追加到 failed_patches,反馈给下轮 prompt。

forcontextin_iterate_with_output_directory(context, output_directory,self._max_iterations):coder = ClaudeLikeCoder(agent_context=context,detection=detection,llm_api_manager=LlmApiManager.from_environment(model="claude-3-7-sonnet-20250219", custom_llm_provider="anthropic"),)prompt = make_prompt(context, detection, failed_patches)diff = coder.run(context, prompt)action: ActionifdiffisNoneorlen(diff.strip()) ==0:action = NoPatchAction()else:action = context["evaluator"].evaluate(context, diff, detection)store_debug_file(context,"prompt.txt", prompt)store_debug_file(context,"diff.txt",diff.decode(errors="replace")ifdiffisnotNoneelse"",)actions.append(action)ifisinstance(action,(VulnerableDiffAction,CompilableDiffAction,UncompilableDiffAction,WrongDiffAction,),):failed_patches += FAILED_PATCH_TEMPLATE.format(failed_patch=diff.decode(errors="replace")ifdiffisnotNoneelse"")else:breakyieldchoose_best_action(actions)EraserAgent

先看下EraserAgent的定义,包含几个关键部分:tools, patterns, gpt-4.1生成补丁模型, models/betarixm/eraser

agents=[EraserAgent(adaptation_client=AdaptationClient.from_environment(),tools=[CppTypeDefinitionTool(),JavaMethodDeclarationTool(),CppFunctionDefinitionTool(),],patterns=[CppCallPattern(limit=None),CppTypeIdentifierPattern(limit=None),JavaInvocationPattern(limit=None),JazzerFunctionSignaturePattern(limit=16),SanitizerFunctionSignaturePattern(limit=8),],episode_length=4,llm_api_manager_for_patching=LlmApiManager.from_environment(model="gpt-4.1"),fallback_llm_api_manager_for_retrieval=LlmApiManager.from_environment(model="models/betarixm/eraser",key_of_base_url="VLLM_API_BASE",),)],1. 先用crash_log_analyzer分析崩溃日志,准备修复上下文。

  1. 构建AIxCCEnvironment(自动化修复环境),用tools,patterns,scope_builder 初始化。

  2. 通过 EraserPolicy驱动环境多步交互,policy决定每一步action,环境执行并返回新observation,直到完成。

def act(self, context: AgentContext, detection: Detection):crash_log = context["crash_log_analyzer"].analyze(context, detection)environment = AIxCCEnvironment(tools=self._tools,episode_length=self._episode_length,scope_builder=scope_builder,)llm_api_manager_for_retrieval = self._fallback_llm_api_manager_for_retrievalpolicy = EraserPolicy(patterns=self._patterns,llm_api_manager=llm_api_manager_for_retrieval,)done = Falsewhile not done:action = policy.act(observation, previous_observation)context["logger"].debug(f"Action: {action}")next_observation, terminated, truncated = environment.step(action=action,observation=observation,context=None,)context["logger"].debug(f"Next observation: {next_observation}")done = terminated or truncatedprevious_observation = copy.deepcopy(observation)observation = next_observationrelative_patches, _ = generate_patch_using_langchain(documents=observation,source_directory=context["pool"].source_directory,chat_model=self._llm_api_manager.langchain_litellm(),)通过 EraserPolicy驱动环境多步交互

class EraserPolicy(BaseEraserPolicy):def init(self,patterns: list[BasePattern],llm_api_manager: LlmApiManager,):super().init(patterns)self._llm_api_manager = llm_api_managerdef completions_from_prompts(self, prompts: list[Prompt]) -> list[AssistantMessage]:result: list[AssistantMessage] = []with self._llm_api_manager.openai_chat_completion_create() as create:for prompt in prompts:message = create(messages=prompt).choices[0].message.contentassert message is not Noneresult.append({"role": "assistant","content": message,})return resultFuzzing优化

导向fuzzing


Overview of sinkpoint-focused directed fuzzing architecture

支持多语言的fuzzing工具


UniAFL

•亮点

  1. 在决赛中贡献了69.2%的pov

  2. 支持多语言fuzzing

  3. 将大模型应用于输入生成和变异环节

  4. 同时在架构和工作流上改进fuzzing效率

  5. 包含6个输入生成模块,在传统fuzzing和基于LLM间做到动态权衡a. 不使用LLM,使用libFuzzer和Jazzerb. 不使用LLM, 混合fuzzing模式c. 有限使用LLM, 将LLM应用在字典生成d. 有限使用LLM, 利用LLM将输入表示为TestLang,并基于TestLang进行变异e. 有限使用LLM, 利用LLM生成python脚本,用于输入生成f. 大量使用LLM, 利用大模型构造污点传播链,识别潜在的漏洞,生成输入

Input Generator

Unique POV (AIxCC Final)

Seed Contribution (Internal Round)

Given Fuzzer

48

69.9%

Hybrid Fuzzer

2

0.2%

Dictionary-based

0

4.8%

Testlang-based

8

42.7% (Separate Seed Pool)

MLLA (+Standalone)

7

2.2%

Given Seeds, etc

9

22.9%

Module

POV Submission by Module

Atlantis-Multilang

69.2%

Atlantis-C

16.8%

Atlantis-Java

14.0%

CP Language

POV Distribution by CP Language

C-based

78.5%

Java-based

21.5%

总结

• 在漏洞挖掘阶段对传统程序分析的大量改进

• 大模型需要和传统的程序分析工具,fuzz工具,符号执行工具等结合

• 大模型是传统程序分析方法的“增益品”,而非“替代品”

• 传统程序分析方法和大模型,“孰重孰轻”,要看不同的对象目标,比如Atlantis-C 走“重插桩/轻 LLM”,Atlantis-Multilang 走“轻插桩/重 LLM”。

• 模型不是越大越好,8B模型既够大:能理解常见代码模式、API 约定、异常栈含义、fuzz 触发路径等。又够小:输出更简短、决策更直接,不容易把简单问题复杂化。

• 大模型在fuzzing的应用:字典生成,种子生成,输入生成

原文链接:https://mp.weixin.qq.com/s/Ffy1e6ojxj1VhrigQvtgHw