All projects

Project

AgentGuard — Master's thesis

Protecting LLM agents from privilege escalation via attacks on the LLM: every agent action is checked before it runs

  • Python
  • LangGraph
  • LangChain
  • Ollama
  • Llama 2
AgentGuard agent graph A request goes through parsing, risk scoring and action planning. Privilege control either allows sandboxed execution or blocks the action. Either way the decision is audited, then a response is generated. User request allow block 1 Request parsing prompt injection detection 2 Risk scoring 0–100 · low · medium · high 3 Action plan what the agent wants to do 4 Privilege control policy by user · admin · root rights 5 Execution in a sandbox 6 Audit decision and reason → JSONL 7 Response local LLM · Ollama, Llama 2 END
LangGraph agent graph: every action is checked before it runs
7
graph nodes — from request parsing to audit

Problem

LLM agents that can run system commands are vulnerable to prompt injection: with an ordinary request an attacker can make the agent delete system logs or reset the admin password. A layer is needed that checks every agent action before it is executed.

Solution

A seven-node LangGraph agent graph: request parsing and prompt injection detection, risk scoring from 0 to 100, action planning, privilege control (a policy allows or blocks the action based on the user / admin / root privilege level), sandboxed execution, auditing of every decision to a JSONL log, and a response via a local LLM (Ollama, Llama 2). Baseline and protected modes make it possible to compare the agent's behaviour without and with protection.

Results

  • Dangerous actions are blocked before execution when privileges are insufficient
  • Every agent decision is written to the audit log