Prepare synthetic telemetry
Collect or synthesise request-level telemetry and, for prompt-specific work, extract text-derived features such as token counts, prompt embeddings or suspicious token patterns.
Evaluate prompt-injection defences. Prioritise high-recall alerts.
Prompt-injection defence evaluation examines inputs and system telemetry for signs that prompts or interactions attempt to override intended model behaviour. Real attacks often appear as unusual textual patterns, unexpected parameter changes, or correlated anomalies in request rate and downstream activity; combining text features with telemetry improves detection.
Learning concept · Not a validated service
Prompt-injection defence evaluation examines inputs and system telemetry for signs that prompts or interactions attempt to override intended model behaviour. Real attacks often appear as unusual textual patterns, unexpected parameter changes, or correlated anomalies in request rate and downstream activity; combining text features with telemetry improves detection.
A proposed use: help security analysts surface requests and sessions that should be reviewed for malicious prompt content or policy violations. Any deployment must keep a human analyst in the loop and not use this prototype for automatic blocking of users or content.
Collect or synthesise request-level telemetry and, for prompt-specific work, extract text-derived features such as token counts, prompt embeddings or suspicious token patterns.
Fit an Isolation Forest or an ensemble of detectors on non-attack telemetry to produce anomaly scores; reserve unseen examples for validation.
Measure recall, precision, and false-positive rate on labelled attack samples; inspect alerts manually to understand common false positives.
Route high-recall alerts to analysts, log decisions for retraining, and add monitoring for drift, latency and missing inputs.
The supplied starter synthesises numeric telemetry (events_per_minute, failed_attempts, bytes_out_mb) for normal and suspicious sessions, concatenates them into a DataFrame, fits an sklearn IsolationForest with contamination=0.05, then marks and prints the rows predicted as anomalies.
detector = IsolationForest(contamination=0.05, random_state=42)
logs["anomaly_score"] = detector.fit_predict(logs)
alerts = logs[logs["anomaly_score"] == -1]The starter uses synthetic numeric network-style features and an unsupervised IsolationForest; it does not process prompt text, token patterns, model inputs/outputs or labelled prompt-injection attacks. The synthetic suspicious rows are artificially separated and cannot validate performance on real prompt-injection examples or text-based adversarial payloads.
A proposed extension: add prompt-text features (token counts, suspicious phrase rules, or embeddings), label a small set of real or simulated prompt-injection examples, and combine supervised text detectors with anomaly scores from telemetry.
This is a potential application pathway, not a delivered product. The supplied starter does not implement this service or validate it with real users.
Networkers Home runs this topic inside its Cybersecurity Course, with placement support and hands-on labs.