{"record":{"id":"a2ba5aeda0a10b50","repo":"NousResearch/hermes-agent","slug":"requested-toolsets-would-broaden-parent-permission","errorCode":null,"errorMessage":"Requested toolsets would broaden parent permissions.","messagePattern":"Requested toolsets would broaden parent permissions\\.","errorType":"exception","errorClass":"SubagentLifecycleError","httpStatus":null,"severity":"error","filePath":"agent/subagent_lifecycle.py","lineNumber":538,"sourceCode":"                json.dumps(dict(request.metadata), sort_keys=True).encode()\n            )\n        except (TypeError, ValueError) as exc:\n            raise SubagentLifecycleError(\"metadata must be JSON-serializable.\") from exc\n        if metadata_bytes > _MAX_METADATA_BYTES:\n            raise SubagentLifecycleError(\"metadata exceeds 8192 bytes.\")\n        if request.allowed_toolsets:\n            from toolsets import TOOLSETS\n\n            unknown = set(request.allowed_toolsets) - set(TOOLSETS)\n            if unknown:\n                raise SubagentLifecycleError(\n                    f\"Unknown toolsets: {', '.join(sorted(unknown))}.\"\n                )\n            enabled = getattr(parent, \"enabled_toolsets\", None)\n            if enabled is not None and not set(request.allowed_toolsets).issubset(\n                set(enabled)\n            ):\n                raise SubagentLifecycleError(\n                    \"Requested toolsets would broaden parent permissions.\"\n                )\n","sourceCodeStart":520,"sourceCodeEnd":541,"githubUrl":"https://github.com/NousResearch/hermes-agent/blob/c896c09c42910c584c4c7d2325b58c14713ea42c/agent/subagent_lifecycle.py#L520-L541","documentation":"Security validation from SubagentLifecycleManager._validate_request(): when the parent agent has an explicit enabled_toolsets set, the requested allowed_toolsets must be a subset of it. A child may never have toolsets the parent itself does not — the check prevents privilege escalation through subagent launching.","triggerScenarios":"A parent restricted to [\"search\"] asked to launch a child with allowed_toolsets=[\"terminal\", \"search\"]; platform-scoped agents (e.g. messaging) requesting web/file toolsets they were not granted; a request template built for a full-CLI parent reused under a restricted profile.","commonSituations":"Running the same plugin across CLI (broad tools) and gateway/messaging (narrow tools) contexts; profile or per-platform tool restrictions in config.yaml (tools.<platform>.enabled); least-privilege setups where the parent was deliberately narrowed.","solutions":["Intersect the request with the parent's live set: pass allowed_toolsets=[t for t in wanted if t in (parent.enabled_toolsets or wanted)].","Widen the parent's own toolset configuration (hermes tools or tools.<platform>.enabled in config.yaml) if the child genuinely needs more — a deliberate operator decision, not a per-launch one.","Drop the allowed_toolsets field entirely so the child inherits the parent's enabled set."],"exampleFix":"# before\nrequest = SubagentLaunchRequest(goal=g, allowed_toolsets=[\"terminal\", \"file\"])\n# parent (messaging) only has [\"search\", \"file\"] -> rejected\n\n# after\nenabled = set(parent.enabled_toolsets or [])\nrequest = SubagentLaunchRequest(\n    goal=g,\n    allowed_toolsets=[t for t in (\"terminal\", \"file\") if not enabled or t in enabled],\n)","handlingStrategy":"validation","validationCode":"enabled = set(getattr(parent, \"enabled_toolsets\", None) or [])\nif enabled:\n    wanted = [t for t in requested if t in enabled]\nelse:\n    wanted = requested  # parent unrestricted\nrequest = SubagentLaunchRequest(goal=goal, allowed_toolsets=wanted)","typeGuard":null,"tryCatchPattern":"try:\n    manager.launch(request)\nexcept SubagentLifecycleError as exc:\n    if \"broaden parent permissions\" in str(exc):\n        request = dataclasses.replace(request, allowed_toolsets=None)  # inherit parent\n        handle = manager.launch(request)\n    else:\n        raise","preventionTips":["Compute the requested set as an intersection with parent.enabled_toolsets before launch.","Omit allowed_toolsets to have the child inherit the parent's set — never wider.","If a child legitimately needs more tools, widen the parent via hermes tools / config.yaml as an operator decision."],"tags":["subagents","delegation","security","privilege-escalation","toolsets"],"backgroundTag":null,"analyzedSha":"c896c09c42910c584c4c7d2325b58c14713ea42c","analyzedAt":"2026-08-14T17:18:01.089Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}