A mechanism for injecting additional context or guidance into workflow prompts without modifying individual workflow files.
When starting a workflow, you may want to add an extra prompt/nudge that all agent calls should be mindful of. Without a centralized solution, you'd need to customize each workflow JSON file individually.
Add a top-level nudge field to workflow JSON:
{
"name": "My Workflow",
"nudge": "Always consider gas optimization and reentrancy in your analysis",
"steps": [...]
}The nudge gets injected at execution time in core/task.py before building the command.
Set RECON_WORKFLOW_NUDGE at runtime:
RECON_WORKFLOW_NUDGE="Focus on edge cases" python main.py workflow.jsonThis requires zero changes to workflow files and can be set per-run.
The injection happens in execute_task_step() where prompts are already being processed (agent file loading, path resolution). Before building the command for AI steps (CLAUDE_CODE, OPENCODE), prepend/append the nudge:
if workflow.nudge or os.environ.get('RECON_WORKFLOW_NUDGE'):
nudge = workflow.nudge or os.environ.get('RECON_WORKFLOW_NUDGE')
prompt = f"{step.prompt}\n\n---\nReminder: {nudge}"Note: Only inject for AI model steps, not PROGRAM steps.
Injecting a nudge changes the prompt structure, which can have unintended effects:
- Attention shift - Model might over-index on the nudge and lose focus on the actual task
- Instruction conflict - Step says "focus only on X" but nudge says "always consider Y"
- Output format disruption - Steps expecting structured output could be derailed
- Signal dilution - Carefully tuned agent prompts may lose specificity
Add a useNudge field on each step. Default to true, but allow steps to opt out:
{
"name": "Step 1",
"prompt": "...",
"useNudge": false
}Put nudge at the end as a "reminder" rather than at the start as a "directive". Models weight early content more heavily. A trailing nudge is a softer constraint:
[actual task prompt]
---
Reminder: {nudge}
Frame the nudge as context, not instruction:
- Bad: "Always check for reentrancy"
- Better: "Context: This audit prioritizes reentrancy concerns"
Run the same workflow with and without nudge, compare outputs. This is the only reliable way to measure impact.
A 10-word nudge is safer than a 100-word one. The nudge should be a gentle steering, not a hard override.
The nudge system provides a meta-solution for adding workflow-wide guidance without modifying individual step prompts. The key architectural insight is that prompts are already being transformed at execution time, so nudge injection fits naturally into that pattern. Use the opt-out mechanism for sensitive steps where the nudge might interfere.