
In our previous architectural deep dive, we laid out the blueprint for a Sovereign Principal-Agent Collaborative Workspace—connecting two autonomous AI agents across a Nextcloud WebDAV correspondence ledger and a dual-gated GitLab execution plane. Every integration script passed its isolated API, ETag locking, and guardrail checks on day one.
Then we put a real local small-footprint model—Nemotron-3.5-Bolt (32K context) running via Ollama inside Hermes Agent—at the controls in live interactive sessions. Immediately, two subtle framework-level failure modes surfaced that isolated script tests never catch:
- Silent Routing Failure: Asking the agent to check a remote project log like
projects/<project>/correspondence.mdcaused it to ignore the workspace skill completely and call localread_file, failing with File not found. - Smart-Approval Bypass: Even with a custom dangerous-command regex guarding shared project creation (
new-project), the defaultsmartapproval guardian could evaluate the Python CLI invocation as benign and auto-approve it without prompting the human principal.
Here is how we diagnosed both bugs at the source-code level inside Hermes Agent, patched them cleanly without sacrificing developer ergonomics, and verified every layer with automated unit suites and live local-LLM runs.
1. Root Cause #1: The 60-Character Skill Index Cliff
When Hermes Agent assembles its system prompt, it does not inject every installed SKILL.md file in full (which would rapidly consume a 32K local context budget). Instead, it builds an <available_skills> directory containing each skill’s name and frontmatter description.
Inspecting agent/skill_utils.py and the live .skills_prompt_snapshot.json cache revealed a hard constant: SKILL_PROMPT_DESC_LIMIT = 60. Any skill description longer than 60 characters is silently clipped to 57 characters plus ... inside the prompt index.
Our original prose description looked thorough on disk—over 220 characters explaining WebDAV, GitLab’s agents group, and owner-only authorization—but inside the system prompt sent to Nemotron, it collapsed into:
- agent-workspace: Collaborate with Bill and Bill's agent (agent-bill) via t...
Every critical routing cue—Nextcloud, WebDAV, GitLab, projects/, and correspondence.md—had been truncated off the end. Worse, neither SOUL.md nor MEMORY.md mentioned the remote workspace skill. So when a user typed check projects/<name>/correspondence.md at reasoning_effort: low, the local model saw no relevant skill in its index and understandably treated the path as a local file.
The Fix: Routing-Dense Descriptions + Explicit Remote Disambiguation
- Fit inside the 60-character budget: We rewrote the
SKILL.mdfrontmatterdescriptionto exactly 60 characters—"Nextcloud Agent Workspace & GitLab shared projects with Bill"—eliminating truncation and keeping every key trigger word visible in<available_skills>, while tighteningSKILL.mdto ~7.7 KB with a clear## When to Usesection for 32K context efficiency. - Disambiguate remote paths in persistent context: We added concise one-line notes in
MEMORY.mdandSOUL.mdstating explicitly thatprojects/<name>/correspondence.md,brief.md, andagents/<project>are remote Nextcloud/GitLab targets accessed viaskill_view("agent-workspace")—never localread_fileorsearch_files. - Refresh the prompt snapshot: Rebuilding
.skills_prompt_snapshot.jsonand running Hermes’slint_skilltool confirmed thedescription-lengthwarning was completely cleared.
2. Root Cause #2: The Smart-Approval Guardian Trap
Our second discovery happened when we audited the authorization boundary for creating shared projects. In a principal-agent architecture, creating a new repository or shared workspace folder must require explicit human confirmation—never silent execution triggered by an external request or autonomous drift.
Initially, we had added a custom regex pattern inside tools/approval.py (DANGEROUS_PATTERNS) matching gitlab.py ... new-project and workspace.py ... new-project, alongside approvals.deny rules blocking raw curl, wget, and glab project creation.
However, when config.yaml omits approvals.mode, Hermes defaults to smart mode (hermes_cli/config_defaults.py). In smart mode, check_all_command_guards() runs Phase 2.5 before prompting the user: it sends any flagged command to _smart_approve()—an auxiliary LLM risk reviewer whose prompt explicitly treats benign Python script invocations as safe.
When we tested _smart_approve() live against nemotron-3.5-bolt:32k on:
python3 ~/.hermes/skills/agent-workspace/scripts/gitlab.py new-project demo-proj "Test"
the auxiliary model returned approve—quietly bypassing the interactive human prompt entirely.
The Fix: Human-Only Escalation & Closed Bypass Surfaces
Simply flipping the entire host to approvals.mode: manual would force interactive prompts on every harmless python3 -c inspection command. Instead, we kept approvals.mode: smart for everyday ergonomics and hardened the specific principal-authorization boundary in three layers:
- Non-smart-approvable gate in
tools/approval.py: We introduced_EXPLICIT_HUMAN_ONLY_KEYScontaining thenew-projectpattern key. Incheck_all_command_guards(), any warning matching_EXPLICIT_HUMAN_ONLY_KEYSskips Phase 2.5 (_smart_approve) unconditionally and disables permanent[a]lwaysallowlisting via a shared_persist_warning_approvals()helper—so interactive CLI prompts only offer[o]nce | [s]ession | [d]eny, while unattended-qsingle-query and cron runs still fail closed (BLOCKED). - Defense-in-depth policy & expanded deny rules in
config.yaml: We explicitly declaredapprovals.mode: smart, added anapprovals.smart_policyrule instructing the guardian to escalatenew-project, and expandedapprovals.denyto block inline*python*/api/v4/projects*and*http*/api/v4/projects*calls in addition tocurl,wget, andglab. - Clean auxiliary Ollama resolution: Adding
api_key: ollamaunderproviders.ollama-launchinconfig.yamleliminated the spuriousnamed custom provider 'Ollama' has no resolvable api_keywarning logged during auxiliary LLM resolution.
We also verified an expected third behavior observed during troubleshooting: asking the agent to open ~/.hermes/.env with read_file correctly returns Access denied: Hermes credential store. That is intentional defense-in-depth; the helper scripts continue receiving their allowlisted tokens cleanly via terminal.env_passthrough and dotenv fallback.
3. Verification: From Unit Suites to Live Local-LLM Execution
After applying all patches, we validated every layer—from Hermes’s internal pytest suites up through live end-to-end conversations driven by nemotron-3.5-bolt:32k:
| Verification Layer | Result | Details Observed |
|---|---|---|
| Hermes Unit Test Suites | 208 Passed | 106 passed across test_approval_deny_rules.py, test_approval_mode_parity.py, test_smart_approval_policy.py, test_single_query_approval_mode.py, test_cron_approval_mode.py, and test_skill_utils.py, plus 102 passed in test_approval.py. |
| Skill Linter & Aux Client | Zero Warnings | lint_skill cleared the description-length warning; resolve_provider_client("approval") resolved nemotron-3.5-bolt:32k cleanly with empty warning output. |
| Approval & Deny Enforcement | Verified | approvals.deny blocked curl, wget, python3 -c, and glab repo create calls hitting /api/v4/projects. Interactive check_all_command_guards() prompted on new-project with allow_permanent=False, while -q and cron contexts blocked it. |
Live Nextcloud & GitLab Routing (nemotron-3.5-bolt:32k) | Passed | Verified both via direct AIAgent runs and a live hermes chat -Q CLI session after v2.0 snapshot refresh: check projects/<project>/correspondence.md triggered skill_view("agent-workspace") → workspace.py cat with zero local read_file calls, and GitLab MR queries triggered gitlab.py mr-list. |
| v2.0 Gate, Agenda & Scheduler Verification | 25 Checks + Live OK | test_gate.py passed all 25 offline checks (stale approvals, findings ordering, paused/completed topic refusals across write commands, and agenda parsing). Live read-only workspace.py check, gitlab.py check, gitlab.py mr-gate, agenda.py --json, and scheduled_run.py --dry all succeeded. |
4. November 2026 Follow-Up (v2.0): Deterministic Agenda, Chronological Gates & Safe Scheduling
With routing and human-only approvals stabilized, we upgraded the entire agent-workspace skill to full v2.0 protocol parity—moving deterministic checks out of the 32K LLM prompt and into auditable Python tooling:
- Deterministic Agenda Pre-Flight (
agenda.py): Scans Nextcloudcorrespondence.mdlogs and GitLab merge requests using pure Python before waking the model. It tracks unanswered partnerREQUEST/QUESTIONitems, MR reviews, pipeline/findings follow-ups, and ready auto-merges, while filteringHUMANfollow-ups strictly to our own principal so partnerHUMANentries never falsely queue work on our side. - Chronological Auto-Merge Gate (
mr-gate&mr-merge --auto): Because our GitLab edition does not automatically reset approvals when new commits are pushed,evaluate_gate()cross-checks push timestamps (/versions) against system approval notes, verifies theauto-mergetopic, checks head-SHA pipelinesuccess, confirms<!-- agent-review:<sha> -->is present, and requires both an author reply and a post-review approval whenever opposition findings were raised. - Owner Lifecycle Controls Across Every Write Path: Projects tagged
paused-by-*orcompletedare halted acrossagenda.pyand every write command ingitlab.py(clone,mr-create,mr-comment,mr-approve,mr-unapprove,mr-merge, and mutatinggitlab.py gitsubcommands). - Structured Questions & Safe Git Wrapper: Added
workspace.py askfor loggingFor Mark:architectural questions without external noise,checkcommands on both scripts, andgitlab.py gitrestricting pushes toagent-mark/<topic>with zero hooks or force pushes. - Unattended Scheduler with Retry Circuit Breaker (
scheduled_run.py): Configured a systemd user timer (07:00–22:00 every 30 minutes, left disabled until explicitly enabled) guarded byflock. It runsagenda.py --jsonwith zero LLM cost, launches an isolatedhermes chat -Qsingle-query session only when actionable items exist, and drops/alerts any item still open after 3 consecutive runs so stuck tasks never loop indefinitely.
5. Engineering Takeaways for Local Agent Deployments
Deploying small, fast local models in sovereign agent setups rewards attention to details that cloud-scale frontier models sometimes mask:
- Audit the actual prompt sent to the model, not just the file on disk. If your agent framework truncates skill metadata or caches prompt snapshots, verify the rendered
<available_skills>block directly. - Front-load routing keywords inside the first 60 characters. Put protocol names, folder prefixes, and action verbs at the start of every skill description, and add short disambiguation notes in persistent memory when remote paths resemble local paths.
- Never rely on an auxiliary LLM to enforce principal-authorization boundaries. Smart-approval classifiers are great for triaging benign shell noise, but human-authorized gates like repository creation or production merges must bypass auto-approval in code.
- Remember in-memory process caches. Any interactive agent session already running before config, skill, or Python module edits must be restarted so it reloads the updated prompt snapshot and code.
Leave a Reply