Detect Command Obfuscation and Parser-Mismatch Attacks
Agent QA & Security
120-180 minutes0/4 steps0%
Step 1 of 4
Build multi-view quote extraction
Different attacks are visible at different stripping levels.
First time here? Paste the Context Pack first so the AI understands your project - open it from the header above.
Prompt Capsule
Implement an extraction function producing three views of every command: KEEP-DOUBLE (single-quoted content stripped, double-quoted kept - because shell metacharacters like ';' and '|' still act inside double quotes in some positions and this view exposes them), FULLY-UNQUOTED (all quoted content stripped - the view for redirection detection, since quoted '<' and '>' are inert), and KEEP-QUOTE-CHARS (content stripped but the quote characters themselves preserved - the view that reveals quote-adjacency attacks like a quoted fragment abutting a '#'). Build the underlying quote-state tracker carefully: process backslash escapes BEFORE quote toggling - inside double quotes, an escaped quote is a literal character, and toggling on it desyncs the tracker for the rest of the command. Unit-test the tracker against nasty edges: escaped quotes inside quotes, adjacent empty quotes, unterminated quotes.
Paste into EmergentFull Build: complete implementation prompt with explicit requirements
Quick is short. Full Build is recommended for most steps. Strict forces real logic when the AI keeps faking output.
Actual change check
Expected after this step
A tested extraction utility returning all three views with a correct state tracker.
Should NOT happen
- An existing feature broke
- A button only logs to console
- Data disappears after refresh
- Errors fail silently with no visible state
This is what should exist before you continue. If reality does not match, do not move on.
Track what changed, failed, or needs follow-up. Notes export with the flow.
Pass the Verify Gate to complete this step