mirror of
https://github.com/affaan-m/ECC.git
synced 2026-11-07 16:45:53 +00:00
fix(skills): prevent option-shaped agent IDs
This commit is contained in:
1 parent
3eb0eefbb3
commit
30e403b9bc
1 file changed
+3
-1
@@ -48,7 +48,7 @@ Use an allowlist for identifiers that become filenames, keys, selectors, or comm
|
||||
```python
|
||||
import re
|
||||
|
||||
SAFE_AGENT_ID_CHARS = re.compile(r"^[A-Za-z0-9_-]+$")
|
||||
SAFE_AGENT_ID_CHARS = re.compile(r"^[A-Za-z0-9_][A-Za-z0-9_-]*$")
|
||||
|
||||
def require_agent_id(value: object, *, max_length: int) -> str:
|
||||
if isinstance(max_length, bool) or not isinstance(max_length, int) or max_length < 1:
|
||||
@@ -62,6 +62,8 @@ def require_agent_id(value: object, *, max_length: int) -> str:
|
||||
return value
|
||||
```
|
||||
|
||||
When an identifier becomes a CLI argument, pass it through an argv API and place it after the command's end-of-options marker where supported. Character validation is not a substitute for argument separation.
|
||||
|
||||
Reject missing and whitespace-only environment values before constructing a client:
|
||||
|
||||
```python
|
||||
|
||||
Reference in new issue
Block a user