Inkog vs Semgrep
Semgrep is a generic SAST tool. Inkog is purpose-built for AI agents.
The Difference
| Aspect | Semgrep | Inkog |
|---|---|---|
| Focus | All code vulnerabilities | AI agent behavioral flaws |
| Detection | Pattern matching on AST | Semantic analysis + taint tracking |
| Understands | Code syntax | Agent loops, tool chains, LLM flows |
| Frameworks | None (generic) | 16 AI frameworks natively |
| Compliance | Generic CWE | EU AI Act, OWASP LLM, NIST AI RMF |
What Semgrep Catches
# Semgrep rule: python.lang.security.audit.dangerous-subprocess-use
subprocess.run(user_input, shell=True) # ✓ DetectedSemgrep finds this because it matches the pattern subprocess.run(..., shell=True).
What Semgrep Misses
# Agent loop without termination
while llm.should_continue():
result = llm.invoke(prompt)
prompt = result # Feedback loop
# Semgrep: No finding (not a known pattern)
# Inkog: CRITICAL - Infinite loop detectedSemgrep doesn’t understand that this is an agent loop. Inkog’s Universal IR recognizes the LoopNode → LLMCallNode → feedback pattern.
Real Example
from langchain.agents import AgentExecutor
agent = AgentExecutor(
agent=react_agent,
tools=tools,
# No max_iterations
)| Tool | Finding |
|---|---|
| Semgrep | Nothing |
| Inkog | CRITICAL: AgentExecutor without iteration limit (infinite loop risk) |
When to Use Each
Use Semgrep for:
- SQL injection in web apps
- XSS in templates
- Generic code quality
- Custom rules for your codebase
Use Inkog for:
- AI agent security
- LLM application vulnerabilities
- Compliance (EU AI Act, OWASP LLM)
- Multi-agent systems
Use Both
They’re complementary. Run Semgrep for traditional vulnerabilities, Inkog for AI-specific issues:
# .github/workflows/security.yml
jobs:
security:
steps:
- uses: returntocorp/semgrep-action@v1
- uses: inkog-io/inkog-action@v1Bottom Line
Semgrep is excellent for general SAST. It has no AI agent awareness.
Inkog understands agent loops, tool chains, prompt flows, and multi-agent delegation. It maps to AI-specific compliance frameworks.
Different tools, different jobs.
Last updated on