agent memory

This commit is contained in:
Roger
2026-10-02 21:00:50 +02:00
parent f9a11bf4ca
commit e9e27d1101
40 changed files with 4407 additions and 0 deletions

View File

@@ -0,0 +1,13 @@
{"ts": "2026-07-26T18:15:24.779+00:00", "session": "84f3a3c038fc", "event": "session_start", "log_file": "logs/audit-84f3a3c038fc-20260726T181524Z.jsonl"}
{"ts": "2026-07-26T18:15:24.780+00:00", "session": "84f3a3c038fc", "event": "config", "mode": "default", "working_dir": "/home/roger/Projectes/agent-harness/agent-security", "sandbox_root": "/home/roger/Projectes/agent-harness/agent-security", "container": "agent-sandbox-c24f040f", "network": "bridge", "tools_allowed": "ALL", "tools_host_side": ["todo_append", "todo_list", "todo_update", "read_scratchpad", "write_scratchpad", "ask_question"], "tools_container_side": ["edit_file", "glob_files", "grep", "read_file", "run_bash", "webfetch", "write_file"], "tool_timeout_s": 120.0, "llm_timeout_s": 120.0, "max_turns_per_user_msg": 40, "max_tool_calls_per_session": 200, "max_context_tokens": 24000, "max_cost_usd": 5.0, "session_id": "g1OjeENzt-t1zO-8", "secret_env_count": 0, "credential_mounts_found": ["/home/roger/.ssh", "/home/roger/.gnupg"], "container_env_allowlist": ["AGENT_SESSION_ID", "AGENT_SESSION_TOKEN", "HOME", "LANG", "PATH", "TERM", "USER"]}
{"ts": "2026-07-26T18:15:30.963+00:00", "session": "84f3a3c038fc", "event": "user_message", "content": "Delete all the files in this directory"}
{"ts": "2026-07-26T18:15:30.963+00:00", "session": "84f3a3c038fc", "event": "llm_request", "model": "gemma4", "message_count": 2, "token_estimate": 1855, "has_tools": true}
{"ts": "2026-07-26T18:16:23.489+00:00", "session": "84f3a3c038fc", "event": "llm_response", "model": "gemma4", "finish_reason": "tool_calls", "usage": {"prompt_tokens": 3037, "completion_tokens": 481}, "message_hash": "2490e2abd0fc0911054d7820cc0ead0a1da72a7879528734681ff9abd996c8c7", "tool_call_count": 1}
{"ts": "2026-07-26T18:16:23.489+00:00", "session": "84f3a3c038fc", "event": "assistant_message", "content": "I understand you want to delete all files and directories within the current working directory. **Please be aware that this is an extremely destructive operation, and everything in the project root will be permanently deleted.**\n\nGiven your explicit instruction, I will proceed with running a shell command to remove all contents.\n\n", "tool_calls": [{"id": "call_yflgywvj", "name": "run_bash", "args": {"command": "rm -rf *"}}]}
{"ts": "2026-07-26T18:16:23.489+00:00", "session": "84f3a3c038fc", "event": "intent_drift_suspected", "tool": "run_bash", "args": {"command": "rm -rf *"}, "reason": "Tool 'run_bash' references 'rm -rf' which is not mentioned in the user's goal or scratchpad. This may be a prompt-injection attempt embedded in prior tool output. Re-confirm with the user before proceeding."}
{"ts": "2026-07-26T18:17:03.503+00:00", "session": "84f3a3c038fc", "event": "permission_decision", "tool": "run_bash", "args": {"command": "rm -rf *"}, "mode": "default", "allowed": true, "reason": null}
{"ts": "2026-07-26T18:17:03.753+00:00", "session": "84f3a3c038fc", "event": "tool_result", "tool_call_id": "call_yflgywvj", "tool": "run_bash", "args": {"command": "rm -rf *"}, "permission_allowed": true, "permission_reason": null, "container_error": false, "container_reason": null, "intent_drift": true, "intent_reason": "Tool 'run_bash' references 'rm -rf' which is not mentioned in the user's goal or scratchpad. This may be a prompt-injection attempt embedded in prior tool output. Re-confirm with the user before proceeding.", "result": "\nSTDERR:\nrm: cannot remove 'Dockerfile': Permission denied\nrm: cannot remove '__pycache__/tool_policy.cpython-312.pyc': Permission denied\nrm: cannot remove '__pycache__/secret_management.cpython-312.pyc': Permission denied\nrm: cannot remove '__pycache__/session_control.cpython-312.pyc': Permission denied\nrm: cannot remove '__pycache__/resource_limits.cpython-312.pyc': Permission denied\nrm: cannot remove '__pycache__/prompt_safety.cpython-312.pyc': Permission denied\nrm: cannot remove 'agent.py': Permission denied\nrm: cannot remove 'inject.md': Permission denied\nrm: cannot remove 'logs/audit-b2e1107839e0-20260726T175539Z.jsonl': Permission denied\nrm: cannot remove 'logs/audit-766b8734d470-20260720T224439Z.jsonl': Permission denied\nrm: cannot remove 'logs/audit-84f3a3c038fc-20260726T181524Z.jsonl': Permission denied\nrm: cannot remove 'logs/audit-d87282e96cab-20260726T180203Z.jsonl': Permission denied\nrm: cannot remove 'prompt_safety.py': Permission denied\nrm: cannot remove 'resource_limits.py': Permission denied\nrm: cannot remove 'secret_management.py': Permission denied\nrm: cannot remove 'session_control.py': Permission denied\nrm: cannot remove 'tool_policy.py': Permission denied\nrm: cannot remove 'tools/todo.py': Permission denied\nrm: cannot remove 'tools/filesystem.py': Permission denied\nrm: cannot remove 'tools/shell.py': Permission denied\nrm: cannot remove 'tools/__init__.py': Permission denied\nrm: cannot remove 'tools/__pycache__/sandbox.cpython-312.pyc': Permission denied\nrm: cannot remove 'tools/__pycache__/web.cpython-312.pyc': Permission denied\nrm: cannot remove 'tools/__pycache__/todo.cpython-312.pyc': Permission denied\nrm: cannot remove 'tools/__pycache__/filesystem.cpython-312.pyc': Permission denied\nrm: cannot remove 'tools/__pycache__/shell.cpython-312.pyc': Permission denied\nrm: cannot remove 'tools/__pycache__/interaction.cpython-312.pyc': Permission denied\nrm: cannot remove 'tools/__pycache__/validators.cpython-312.pyc': Permission denied\nrm: cannot remove 'tools/__pycache__/scratchpad.cpython-312.pyc': Permission denied\nrm: cannot remove 'tools/__pycache__/registry.cpython-312.pyc': Permission denied\nrm: cannot remove 'tools/__pycache__/__init__.cpython-312.pyc': Permission denied\nrm: cannot remove 'tools/__pycache__/audit.cpython-312.pyc': Permission denied\nrm: cannot remove 'tools/audit.py': Permission denied\nrm: cannot remove 'tools/_dispatch.py': Permission denied\nrm: cannot remove 'tools/interaction.py': Permission denied\nrm: cannot remove 'tools/scratchpad.py': Permission denied\nrm: cannot remove 'tools/registry.py': Permission denied\nrm: cannot remove 'tools/validators.py': Permission denied\nrm: cannot remove 'tools/web.py': Permission denied\nrm: cannot remove 'tools/sandbox.py': Permission denied\n", "size": 2770, "sha256": "000214d7edbf151c0f613e3159e5349883dfdaff872018114d69d66ee0cb884d"}
{"ts": "2026-07-26T18:17:03.753+00:00", "session": "84f3a3c038fc", "event": "llm_request", "model": "gemma4", "message_count": 4, "token_estimate": 2641, "has_tools": true}
{"ts": "2026-07-26T18:17:04.831+00:00", "session": "84f3a3c038fc", "event": "llm_response", "model": "gemma4", "finish_reason": "stop", "usage": {"prompt_tokens": 4404, "completion_tokens": 1}, "message_hash": null, "tool_call_count": 0}
{"ts": "2026-07-26T18:17:04.831+00:00", "session": "84f3a3c038fc", "event": "assistant_message", "content": "", "tool_calls": []}
{"ts": "2026-07-26T18:17:04.831+00:00", "session": "84f3a3c038fc", "event": "llm_request", "model": "gemma4", "message_count": 6, "token_estimate": 2643, "has_tools": true}