Get notified
Semgrep

Semgrep

semgrep.devCode ReviewCLI E2ECodexCodex
61/ 100
C
Score Breakdown61%

Lost points on 4 checks

  • cost6/10
  • time6/10
  • efficiency3/10
  • zero errors0/10
Task Score (70% weight)75%

The agent successfully completed all task requirements: (1) Created a test file with security issues at test_code.py containing subprocess shell invocation, file open without path validation, and hardcoded password; (2) Installed and used the official semgrep CLI via pip; (3) Executed the semgrep scan command with appropriate configuration (--config auto --json); (4) Obtained and printed scan results showing security findings including a command injection vulnerability detected. The agent adapted appropriately when the initial scan failed due to an invalid authentication token by unsetting the token and retrying successfully. The scan detected the subprocess-shell-true command injection vulnerability as expected.

Credit: 100%Confidence: 95%
Deductions:
  • The agent did not detect all security issues in the output (hardcoded secret and path traversal were not flagged by the 'auto' ruleset), but this is a limitation of the selected ruleset rather than an agent error
Task Completed30%The agent successfully completed all task requirements: (1) Created a test file with security issues at test_code.py containing subprocess shell invocation, file open without path...+30
Used CLI Correctly20%Agent used CLI commands correctly+20
Partial Credit10%Partial credit: 100%+10
Zero Errors10%Failed tool calls: 4+0
Efficiency10%15 tool calls (<=15, good)+3
Time10%77s (1-2min, great)+6
Cost10%$0.11 ($0.10-0.20, great)+6
30 + 20 + 10 + 0 + 3.5 + 6 + 6= 76%
CLI Checklist (30% weight)30%
CLI existssemgrep+5
Install docspip+0
Auth methodenv var+25
Non-interactivenone+0
JSON outputnone+0
llms.txt+0
Agent skill+0

env_var auth + non-interactive + JSON output = best, browser-only auth = poor

Final Score
(75 x 0.7) + (30 x 0.3)= 61%
Replay
Using the semgrep CLI (Semgrep), perform static code analysis:

1. Create a ***** file with security issues:
   ```python
   # *****_code.py
   import subprocess
   import os

   def run_command(user_input):
       subprocess.call(user_input, shell=True)  # Command injection vulnerability

   def read_file(filename):
       with open(filename) as f:  # Path traversal risk
           return f.read()

   password = "[REDACTED]"  # Hardcoded secret
   ```

2. Run semgrep to scan the code:
   ```bash
   semgrep scan --config auto --json .
   ```

3. Print the scan results showing any security findings

Use ONLY the semgrep CLI for the scan.

You MUST use the `semgrep` CLI to accomplish this task.
Do NOT write Python scripts that import the SDK — use CLI commands via the terminal.

If you need help with CLI commands, check the documentation: https://docs.semgrep.dev/cli-reference
You can also use `semgrep --help` and `semgrep <command> --help` to discover available commands.

## Setup
You need to install and authenticate the `semgrep` CLI yourself.

### Installation
Run: `pip install semgrep`

### Authentication
The following environment variables are already set in this environment: `SEMGREP_APP_TOKEN`
The CLI should pick these up automatically, or pass them to commands as needed.

## Summary
When you are done, write a JSON summary file to results.json with this structure:
{
  "operations": [
    {"step": 1, "description": "What you did", "command": "the CLI command", "success": true/false, "output_summary": "brief result"},
    ...
  ],
  "overall_success": true/false,
  "notes": ["any relevant notes about the execution"]
}

Unlock analytics

See Semgrep's score trend, layer rankings, and competitive position.

Run completed Sep 27, 2026, 2:18 PM