Security analysis daemon toolkit with native LLM agent loop for code vulnerability detection and analysis
CTX-Audit is a code security analysis tool written in Rust with 8 tools focused on AST analysis, call graph traversal, vulnerability detection, and text search. The tools are READ_ONLY and well-scoped, but exhibit significant gaps in description quality, schema completeness, and error handling documentation. Tool names follow verb_noun convention (search_symbol, get_file_structure, find_references, query_callers, query_callees, detect_vulnerability_patterns, text_search, regex_search) which is good. Parameter schemas are present but sparse: many lack descriptions, constraints are not formalized (e.g., 'categories' array in detect_vulnerability_patterns has no enum of valid values), and output schemas are entirely absent from the visible code. Error handling is not documented, no recovery guidance, no user-fixable vs. retryable categorization. The tool design is solid (no overlapping responsibilities, clear single-purpose focus), but execution falls short of production-grade quality.
使用预定义规则检测常见安全漏洞模式
查找符号的所有引用位置
获取文件的符号结构(类、函数、方法等)
查询跨文件调用图:找出指定函数调用了哪些函数。输入文件路径和函数名,返回被调用函数列表(含是否外部函数、是否回调、receiver)。用于从入口点追踪数据流到 sink。
查询跨文件调用图:找出所有调用指定函数的函数。输入文件路径和函数名,返回调用者列表(含文件、行号、receiver 信息)。用于从 sink 反向追踪到入口点。
在代码库中使用正则表达式搜索。支持复杂的模式匹配。
搜索符号定义(函数、类、变量等)
在代码库中搜索文本。支持大小写敏感/不敏感搜索,可以指定文件模式过滤。
Output schemas completely undocumented. No visible documentation of what each tool returns, field types, or structure. LLMs cannot plan multi-step operations or extract data from responses without knowing return schema.
Descriptions are too brief or lack LLM-optimization. 'search_symbol' (23 chars), 'find_references' (26 chars), 'regex_search' (27 chars) fall below rubric minimum p10=34 chars. No guidance on WHEN to use each tool vs. similar alternatives (e.g., when to call text_search vs. regex_search).
Parameter constraints not formalized. 'categories' in detect_vulnerability_patterns lists examples in description ('sql_injection, command_injection') but no enum or allowed-values constraint. 'severity' lacks enum despite being a categorical choice (low|medium|high|critical). LLMs will hallucinate invalid values.
Inferred effective spec: <=2025-11-25.
| Scored | Grade | Overall | Spec posture | Rubric |
|---|---|---|---|---|
| 2026-09-23 | F | 42 | <=2025-11-25 | v2 |
Many parameters lack descriptions. 'query_callers' and 'query_callees' have 'recursive' param with no description explaining what recursion returns (direct vs. transitive callers/callees, depth limits, cycle handling). 'limit' in search_symbol has no constraint on max value or rationale for default=20.
No error handling documentation. No visible guidance on what errors are retryable, user-fixable, or fatal. No examples of error messages or recovery steps. If a file path is invalid or a symbol not found, what does the LLM see? No recovery patterns documented.
No pagination support documented. Tools like 'search_symbol' with default limit=20 and 'detect_vulnerability_patterns' that scan entire projects may return hundreds of results. No documented support for offset, page, next_cursor, or total_count in responses. LLM cannot iterate over large result sets.
Parameter naming inconsistencies risk LLM confusion. 'project_path' vs 'path' used interchangeably (query_callers uses 'project_path' + 'file_path', text_search uses just 'path'). Inconsistent naming across similar tools breaks chaining and forces LLM to reason about field mappings.
No documentation of output field names or structure. Tools like 'query_callers' and 'query_callees' promise 'callers list (含文件、行号、receiver 信息)' and 'callees list (含是否外部函数、是否回调、receiver)' but no schema shows actual field names (file? file_path? file_name? row? line? line_number?). Mismatches force LLMs to guess.