Response anomaly detection during Phase 4. Profiles endpoint behavior, flags deviations, prioritizes convergent signals.
TYPOGRAPHY RULE: NEVER use em dashes in any output. Use a hyphen (-) or rewrite.
For each endpoint tested in Phase 4, record via mcp__claude-in-chrome__read_network_requests:
{
"endpoint": "/api/users/123",
"method": "GET",
"response_time_ms": 45,
"status_code": 200,
"content_length": 1842,
"content_type": "application/json",
"headers_present": ["X-Request-Id", "X-RateLimit-Remaining", "Cache-Control", "Vary"],
"headers_absent_vs_others": [],
"error_format": "json_structured",
"set_cookie": false,
"cors_headers": {"Access-Control-Allow-Origin": "*"},
"server_header": "nginx/1.24",
"custom_headers": {"X-Powered-By": "Express"},
"response_body_patterns": ["uuid_v4_ids", "iso_timestamps", "snake_case_keys"]
}
GATE: 10+ endpoints profiled? Proceed to Step 2. Under 10? Keep profiling.
Flag any endpoint that deviates from baseline. Categories:
Timing
Headers
Response Body
Status Code
Cookie/Session
GATE: Anomalies found? Proceed to Step 3. Zero anomalies after 20+ endpoints? Anomaly detection complete for this target.
For each anomaly, generate a hypothesis:
Title: "[Anomaly type] on [endpoint] suggests [backend difference]"
Technique: "[attack class]"
Lens: "anomaly_detection"
Testability: 8-10
Novelty: 7-9
Priority adjustments:
GATE: 2+ anomaly types on same endpoint? That endpoint is convergent - test it FIRST.
GATE: 3+ convergent signals? Stop current testing. Test this endpoint next.
Write to findings/<program>/tmp/anomaly-profile.json:
{
"baseline_endpoints_profiled": 25,
"anomalies_detected": 7,
"convergent_signals": 2,
"anomalies": [
{
"endpoint": "/api/internal/export",
"anomaly_types": ["timing", "header", "body", "status"],
"convergent": true,
"details": {
"timing": "800ms vs 50ms median",
"header": "missing X-RateLimit-Remaining",
"body": "XML error format vs JSON everywhere else",
"status": "200 without auth"
},
"generated_hypothesis_id": "<sha256>",
"priority": "critical"
}
]
}
Convergent hypotheses insert at top of Phase 4 queue. All anomalies feed Phase 4b as observation_type: "anomaly_detected".