trading_agent.doctor.checks.injection_check
¶
Scans the files that become the desks' instructions for text that tries to steer an AI.
It reads the shared instruction files, each desk's Persona.md and Memory.md, and every installed skill's SKILL.md. Memory.md is included because a desk writes it itself, sometimes after reading web pages.
Typical usage example:
result = InjectionCheck(layout, ['main']).run()
InjectionCheck
¶
Bases: DoctorCheck
Checks the instruction files and installed skills for prompt injection.
Creates the check.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
layout
|
WorkspaceLayout
|
Where the files are. |
required |
desk_names
|
Sequence[str]
|
The desks whose files to scan. |
required |
Source code in src/trading_agent/doctor/checks/injection_check.py
run
¶
Scans every file.
Returns:
| Type | Description |
|---|---|
CheckResult
|
OK with the number of files scanned, or a warning listing each suspicious passage. |