{"record":{"id":"5283b45f29cdef24","repo":"usestrix/strix","slug":"scope-name-required-for-create","errorCode":null,"errorMessage":"scope_name required for create","messagePattern":"scope_name required for create","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"strix/tools/proxy/caido_api.py","lineNumber":519,"sourceCode":"\nasync def _scope_rules_with_client(\n    client: CaidoClient,\n    action: ScopeAction,\n    *,\n    allowlist: list[str] | None = None,\n    denylist: list[str] | None = None,\n    scope_id: str | None = None,\n    scope_name: str | None = None,\n) -> Any:\n    if action == \"list\":\n        result = await scope_list(client)\n    elif action == \"get\":\n        if not scope_id:\n            raise ValueError(\"scope_id required for get\")\n        result = await scope_get(client, scope_id)\n    elif action == \"create\":\n        if not scope_name:\n            raise ValueError(\"scope_name required for create\")\n        result = await scope_create(\n            client,\n            name=scope_name,\n            allowlist=allowlist,\n            denylist=denylist,\n        )\n    elif action == \"update\":\n        if not scope_id or not scope_name:\n            raise ValueError(\"scope_id and scope_name required for update\")\n        result = await scope_update(\n            client,\n            scope_id,\n            name=scope_name,\n            allowlist=allowlist,\n            denylist=denylist,\n        )\n    elif action == \"delete\":\n        if not scope_id:","sourceCodeStart":501,"sourceCodeEnd":537,"githubUrl":"https://github.com/usestrix/strix/blob/85513391305171ecc6faffe03da4a8bda5e3febb/strix/tools/proxy/caido_api.py#L501-L537","documentation":"In the Caido scope dispatcher, action='create' requires a scope_name; a missing or empty name raises ValueError before any network activity. Allowlist/denylist are optional — only the human-readable name is mandatory for creating a scope.","triggerScenarios":"Calling the scope handler with action='create' and only allowlist/denylist filters but no scope_name. Common when a caller assumes the filters alone define the scope.","commonSituations":"LLM agent tool call omitting the name field; scripts translating a config of only URL patterns into a create action; empty-string name from an unset variable.","solutions":["Supply a descriptive scope_name alongside the filters: scope(client, 'create', scope_name='target-api', allowlist=[...]).","If scripting, default scope_name from the target host to avoid empty values.","Validate required-argument tables per action before calling the dispatcher."],"exampleFix":"# before\nscope(client, \"create\", allowlist=[\"*target.com*\"])\n\n# after\nscope(client, \"create\", scope_name=\"target\", allowlist=[\"*target.com*\"])","handlingStrategy":"validation","validationCode":"def create_scope_safe(client, name: str | None, allowlist=None, denylist=None):\n    name = (name or f\"scope-{allowlist[0] if allowlist else 'default'}\".replace(\"*\", \"\")).strip()\n    if not name:\n        raise ValueError(\"scope_name required for create\")\n    return scope(client, \"create\", scope_name=name, allowlist=allowlist, denylist=denylist)","typeGuard":null,"tryCatchPattern":"try:\n    scope(client, \"create\", scope_name=name, allowlist=al)\nexcept ValueError as exc:\n    if \"scope_name required\" in str(exc):\n        raise SystemExit(\"provide --scope-name\") from exc\n    raise","preventionTips":["Derive scope_name from the target host when the caller has no natural name.","Make scope_name a required parameter in your wrapper/CLI schema.","Check for whitespace-only names — strip() is not applied before the check here."],"tags":["proxy","caido","scope","validation"],"backgroundTag":null,"analyzedSha":"85513391305171ecc6faffe03da4a8bda5e3febb","analyzedAt":"2026-08-15T05:03:57.275Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}