T09 · Insecure Skill Coding Practices
- Location
examples/disease_discovery.py:19- Finding
Outbound KEGG API Requests Do Not Enforce Network Timeouts
- Content
View full analysis
- Remediation
View remediation
str: url = f"{KEGG_API_BASE}/{operation}" if args: url += "/" + "/".join(str(a) for a in args) kwargs.setdefault("timeout", (5, 30)) response = requests.get(url, **kwargs) response.raise_for_status() return response.text ``` 4. For retries, catch timeout and connection exceptions, impose a finite retry count, use bounded exponential backoff, and avoid retrying indefinitely. 5. Consider enforcing an overall workflow deadline in addition to per-request timeouts so multiple retries cannot exceed the agent task's execution budget. ]]>
