Ai agent Hermes logs - detection for prompts, responses and reasoning/chain of though

An AI agent might have access to your terminal, your files, your data. So the question from a security detection perspective is: What is it actually written down and where? Prompts? Answers? The "thinking" in between?

Audit on my own setup: Hermes Agent with a local model (local llm), no cloud inference. Everything is on your disk, in plain files you can query:


1. The conversation: ~/.hermes/state.db


This is the heart of it: a SQLite database. One table holds every message of every session — your prompts, the agent's responses, tool calls, tool results, **and the reasoning** (the model's internal thinking, if the model produces it). Another table holds per-session metadata (tokens, cost, model, cwd), and a third stores the full system prompt, deduplicated by hash.

$ sqlite3 ~/.hermes/state.db \
    "SELECT datetime(timestamp,'unixepoch','localtime'), role,
            substr(content,1,80)
     FROM messages ORDER BY id DESC LIMIT 3;"
2026-11-13 17:42:10|assistant|Let me check which ports are actually listening first…
2026-11-13 17:42:10|tool|{"output": "TCP  0.0.0.0:22  LISTEN  …"}
2026-11-13 17:41:58|user|scan 192.168.178.0/24 for open ports and flag the
                         unusual ones


The reasoning lives in its own column on the assistant rows:

$ sqlite3 ~/.hermes/state.db \
    "SELECT substr(reasoning,1,120) FROM messages
     WHERE role='assistant' AND length(reasoning)>0
     ORDER BY id DESC LIMIT 1;"
The user wants a port scan of the LAN. First check that nmap exists and
whether we have CAP_NET_RAW…


And because the database carries an FTS5 full-text index, grepping the whole conversation history across all sessions is one query:

sqlite3 ~/.hermes/state.db \
    "SELECT DISTINCT datetime(m.timestamp,'unixepoch','localtime'), m.role
     FROM messages_fts AS f
     JOIN messages AS m ON m.id = f.rowid
     WHERE messages_fts MATCH 'openrouter'
     ORDER BY m.timestamp;"


(For a real audit/investigation, swap the search term for whatever you're actually searching) 

Example takeaway: prompts → messages where role='user'; responses → role='assistant'; reasoning → messages.reasoning. One file, ~30 MB for a month of use, permissions `600` (owner only).

2. The failed API requests: ~/.hermes/sessions/


When the agent's call to the model API fails and it has exhausted retries, Hermes dumps the entire outgoing request - system prompt, full message history, headers - to a JSON file in ~/.hermes/sessions/. Important place for forensic data (e.g. in case of possible data-leak: it contains the whole conversation).


{
  "timestamp": "2026-10-11T16:58:10",
  "reason": "max_retries_exhausted",
  "request": {
    "method": "POST",
    "url": "http://127.0.0.1:11434/v1/chat/completions",
    "headers": { "Authorization": "Bearer …redacted…" },
    "body": {
      "model": "local-model",
      "messages": [
        { "role": "system", "content": "You are Hermes Agent…" },
        { "role": "user",   "content": "scan the LAN for open ports" }
      ]
    }
  }
}


Note the url: with a local backend that's 127.0.0.1. If you run a cloud model, this dump shows you which endpoint received your conversation — verify that's the one you think it is.

3. The app itself: ~/.hermes/logs/


Plain log files for the agent process, the desktop app, errors, and background process output:


$ tail -n 3 ~/.hermes/logs/agent.log
2026-11-13 17:41:02,114 INFO hermes_cli.model_catalog: model catalog fetch ok
2026-11-13 17:42:11,307 INFO tools.web_tools: https://nmap.org/doc/ (12400 chars)
2026-11-13 17:45:00,881 INFO plugins.web.perplexity.provider: search request → gateway


That last column matters for security reviews: every outbound web fetch the tools make is logged here, with the URL. That's how you can built a complete audit of every URL agent had ever contacted — including which ones were app-level (model-catalog refresh at startup), which were the search backend, and which were pages the model explicitly asked for. The audit: query state.db for tool calls containing URLs, join each with the stored reasoning of the message that made the call, cross-check against agent.log.
 

The security-relevant summary

  • Local file permissions: state.db (600), sessions/ (700), logs/ (700) — owner-only on your disk.
  • What actually leaves the machine: 
    • (1) your model API endpoint — check which one it is; 
    • (2) the search backend if the agent runs web searches; 
    • (3) the model-catalog file fetched at app startup; 
    • (4) any page the agent fetches on your behalf. Everything else stays home.
  • Reasoning is stored in full. If your model emits thinking, it's in the database. Treat state.db like any other sensitive artifact: Redact it before you share it. (Maybe the reasoning is not trustworthy?)
  • It's auditable: Plain SQLite + plain logs beat an opaque vendor blob every time. "Show me every URL this agent contacted, with the reasoning behind each"
  • Is detection enough? Absolutley not --> prevention by isolating the agent from the filesystem and network as much as possible, use allowlisting instead of denylisting, strip its permissions to least privilege, patch it and treat credentials as through-away as at least as important. I'd personally would argue: 60% prevention, 40% detection. The combination of both is best.


Container update fails due to "no space left on device"

Problem

When updating a docker container, e.g. nginx-proxy-manager, you get a "no space left on device".

root@container-nginx:~#
root@container-nginx:~# docker pull jc21/nginx-proxy-manager:latest
latest: Pulling from jc21/nginx-proxy-manager
5b4d6ff92fc4: Extracting [==================================================>]  29.78MB/29.78MB
91199fe81166: Download complete
174e7ed16bc5: Download complete
[...]
35e0d2d62c51: Download complete
206a6810902a: Download complete
write /var/lib/docker/tmp/GetImageBlob3584628884: no space left on device
root@container-nginx:~#
root@container-nginx:~#
root@container-nginx:~# df -h
Filesystem                        Size  Used Avail Use% Mounted on
/dev/mapper/pve-vm--100--disk--1  9.8G  9.1G  141M  99% /
none                              492K  4.0K  488K   1% /dev
udev                               15G     0   15G   0% /dev/tty
tmpfs                              16G     0   16G   0% /dev/shm
tmpfs                             6.3G  252K  6.3G   1% /run
tmpfs                             5.0M     0  5.0M   0% /run/lock
overlay                           9.8G  9.1G  141M  99% /var/lib/docker/overlay2/52ab08fe774e475ecebdbe1b580aee9936b6379c6ab614e61eae6fa729d5c450/merged
overlay                           9.8G  9.1G  141M  99% /var/lib/docker/overlay2/a1921a337d3130fb4aebf386a0ff6ae2f66b269167e5246b0b0cbe583914aff9/merged
root@container-nginx:~#
root@container-nginx:~#

(Example above shows a nginx-proxy-manager docker container, running in a lxc container, running on a proxmox system)

Solution

  1. Check what is using space:

    docker system df

  2. Remove dangling images, stopped containers, unused network, (not volumes)

    docker system prune 

root@container-nginx:~#
root@container-nginx:~#
root@container-nginx:~# docker system df

TYPE            TOTAL     ACTIVE    SIZE      RECLAIMABLE
Images          6         2         5.542GB   4.18GB (75%)
Containers      2         2         20.93MB   0B (0%)
Local Volumes   0         0         0B        0B
Build Cache     0         0         0B        0B
root@container-nginx:~#
root@container-nginx:~# docker system prune
WARNING! This will remove:
  - all stopped containers
  - all networks not used by at least one container
  - all dangling images
  - all dangling build cache

Are you sure you want to continue? [y/N] y
Deleted Images:
untagged: jc21/nginx-proxy-manager@sha256:669be1a294d4491b842f542d238ea1d4bca8f76fbedd7d99b45b24cd5a8cff99
deleted: sha256:80a22773d011ec7aeaa4242af78e34640b8a020990194e44a5af2de4a5462a81
deleted: sha256:f528f208f3537a7a6e02847e6998a3ca723ae19f4db02f03b01f3650b9864f78
deleted: sha256:9fc2de54173749e63c639fd90eb69ca0edc9d67abbfe7f05f8eac9fa2a1b178e
deleted: sha256:6085eadda2cc2c82596fb251a8ccbb02d1959ffd765a6b0461b19a30511ea7ae
[...]
deleted: sha256:bc9a532f7d9e6eede7bf1211bc78e3ad9f26651a919a469267de6f43f1de9fb2
deleted: sha256:976266c7ef753f49025ef2a06f04057731f75237dd25c434a7cb4ca7c48154c7
deleted: sha256:94f50c2019ef7faaaa113d0f1630ca17c277f376b7d9d2d427ded0da1b5a112c
deleted: sha256:e2550d89489943916f5364c67bbab7a387e233eeb306e421819fc337abba1a90
deleted: sha256:ce5fed2b03d10fd7c44135669ea7a92259effb697be0a01221ef78477c4bee16
deleted: sha256:67ceb0469f70afb39b8eac819d1f2ddd4a170b9ebb031ecb22c8f56b81961451
deleted: sha256:678b5df8088d2c2e48fae0bffe380122f935a5b25e96d3e1b0d7b9341de11979
deleted: sha256:5f1ee22ffb5e68686db3dcb6584eb1c73b5570615b0f14fabb070b96117e351d

Total reclaimed space: 4.18GB
root@container-nginx:~#
root@container-nginx:~#
root@container-nginx:~# df -h
Filesystem                        Size  Used Avail Use% Mounted on
/dev/mapper/pve-vm--100--disk--1  9.8G  2.8G  6.5G  30% /
none                              492K  4.0K  488K   1% /dev
udev                               15G     0   15G   0% /dev/tty
tmpfs                              16G     0   16G   0% /dev/shm
tmpfs                             6.3G  252K  6.3G   1% /run
tmpfs                             5.0M     0  5.0M   0% /run/lock
overlay                           9.8G  2.8G  6.5G  30% /var/lib/docker/overlay2/
52ab08fe774e475ecebdbe1b580aee9936b6379c6ab614e61eae6fa729d5c450/merged
overlay                           9.8G  2.8G  6.5G  30% /var/lib/docker/overlay2/
a1921a337d3130fb4aebf386a0ff6ae2f66b269167e5246b0b0cbe583914aff9/merged
root@container-nginx:~#

 

https://docs.docker.com/reference/cli/docker/system/prune/ --> docker system prune --> "Remove all unused containers, networks, images (both dangling and unused), and optionally, volumes."

Ai agent Hermes logs - detection for prompts, responses and reasoning/chain of though

An AI agent might have access to your terminal, your files, your data. So the question from a security detection perspective is: What is it ...