Strix (STRIX) — agents module

docs / modules / agents

Strix (STRIX) — agents

flowchart LR IN["IN: role (root/child),\nscan_mode, skills list,\nscope context"] --> ACT["ACT: assemble tools,\nrender system prompt"] ACT --> VAL["VAL: — none\n(construction only,\nno runtime check here)"] VAL --> OUT["OUT: one SandboxAgent,\nready to hand to run_agent_loop()"]

What this is

strix/agents is where a single AI agent gets built — its tool list assembled, its system prompt rendered from a Jinja template and a resolved set of knowledge-pack "skills." It doesn't run anything itself; think of it as the factory that produces the agent object strix/core then drives.

What flows through it

flowchart TD Factory["factory.py\nbuild_strix_agent()"] --> Prompt["prompt.py\nrender_system_prompt()"] Prompt --> Jinja["prompts/system_prompt.jinja"] Prompt -- "loads" --> Skills["strix/skills/*.md\n(scan_modes, tooling,\ncoordination, custom, ...)"] Factory -- "attaches" --> Tools["_BASE_TOOLS + capabilities\n(Shell, Filesystem)"] Factory --> ChildFactory["make_child_factory()\ncaptures run config for\nlater child construction"]

Technical details

flowchart LR IN["IN: role (root/child),\nscan_mode, skills list,\nscope context"] --> ACT["ACT: assemble tools,\nrender system prompt"] ACT --> VAL["VAL: — none\n(construction only,\nno runtime check here)"] VAL --> OUT["OUT: one SandboxAgent,\nready to hand to run_agent_loop()"]

Package: strix/agents/ Depends on: strix.tools (imports every tool module to build _BASE_TOOLS), strix.skills (skill markdown bodies via load_skills()), strix.config (uses_chat_completions_tool_schema — decides tool schema style per model). Depended on by: strix.core (runner.py calls build_strix_agent/make_child_factory directly; execution.py uses the returned child factory closure).

Files at a glance

File Role
factory.py build_strix_agent() — assembles one agents.sandbox.SandboxAgent: tool list, capabilities, lifecycle stop condition. make_child_factory() — returns a closure children are built from.
prompt.py render_system_prompt() — Jinja2 rendering of system_prompt.jinja against a resolved skill set and scope context.
prompts/system_prompt.jinja The actual prompt template: communication rules, authorization/scope framing, execution guidelines, and the root-only <root_agent_directive> block.

Files & functions, explained

factory.py - build_strix_agent(*, name, skills, is_root, scan_mode, is_whitebox, interactive, chat_completions_tools, system_prompt_context, extra_tools, instructions_override) — the main constructor. Assembles _BASE_TOOLS (think, load_skill, todo/notes CRUD, web_search, reporting tools, proxy read tools, agent-graph tools) + _EXTRA_TOOLS (pluggable, via register_agent_tools()) + call-specific extra_tools; appends respond_to_user only if interactive; appends the lifecycle tool (finish_scan for root, agent_finish otherwise). - _with_coerced_arguments / _with_bounded_result — wrap every FunctionTool to repair malformed args and cap output size (delegates to strix.tools.output_store). - _finish_tool_use_behavior — the SDK tool_use_behavior hook: only the four lifecycle tool names end an agent's Runner cycle. - capabilities=[Filesystem(...), Shell(...)] — SDK-native sandbox capabilities; Strix's configurator closures adjust their tool schemas (e.g. renaming apply_patch's input field to patch). - make_child_factory(*, scan_mode, is_whitebox, interactive, chat_completions_tools, system_prompt_context) — returns _factory(*, name, skills) -> SandboxAgent, so core.execution can build children without knowing run-level config internals.

prompt.py - render_system_prompt(*, skills, scan_mode, is_whitebox, is_root, interactive, system_prompt_context) — resolves a skill list (_resolve_skills: caller-requested + always scan_modes/<mode> + always tooling/agent_browser + always tooling/python + coordination/root_agent if root + custom/source_aware_sast if whitebox), loads their markdown bodies, and renders the Jinja template. Root vs. child role is prompt-driven, not tool-driven — both get essentially the same tools; only the root's prompt includes the orchestration directive forbidding it from testing directly.

Related: STRIX — Architecture (HLD), core.md, tools.md, skills.md.