Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
git clone --depth 1 https://github.com/golid-ai/golidWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/rules/golid-ai/golid/external-api)<a href="https://agentmods.dev/rules/golid-ai/golid/external-api"><img src="https://agentmods.dev/badge/rules/golid-ai/golid/external-api/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/rules/golid-ai/golid/external-api"><img src="https://agentmods.dev/badge/rules/golid-ai/golid/external-api.svg" alt="Reviewed on agentmods" width="80" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00000 | $0.00604 |
| Opus 5.5 | $0.00000 | $0.00242 |
| Sonnet 5.5 | $0.00000 | $0.00121 |
| Haiku 4.5 | $0.00000 | $0.00060 |
Grade A, and why
external-api scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3mo ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 68 lines — stays where its author put it; the contents beside it link to each section on GitHub.
External API Integration Patterns
Thesis: External services are wrapped with IsConfigured(), env-sourced credentials, and graceful degradation when unconfigured.
Service Wrapper Structure
type XService struct {
apiKey string
configured bool
client *http.Client
}
func NewXService(apiKey string) *XService {
if apiKey == "" {
slog.Warn("X not configured — feature will be disabled")
return &XService{configured: false}
}
return &XService{apiKey: apiKey, configured: true, client: &http.Client{Timeout: 30 * time.Second}}
}
func (s *XService) IsConfigured() bool { return s.configured }
Every method must check IsConfigured() first and return a clean error, not panic.
Config Flow
API keys and secrets flow: env var → Config struct → service constructor → wire.BuildServices.
.env.local: EXTERNAL_API_KEY=xxx
config.go: ExternalAPIKey string → os.Getenv("EXTERNAL_API_KEY")
wire/services.go: externalService := external.NewExternalService(cfg.ExternalAPIKey)
Template IDs, webhook secrets, and other per-service config follow the same pattern. Never hardcode in service files.
Request Building
- Verify field names against the actual API docs. JSON struct tags must match exactly (e.g.,
roleIndexnotrole_index). - Query params vs body — some APIs put IDs in the URL, not the body. Check the docs.
- URL-encode all query parameter values with
url.QueryEscape(). - Set timeouts on the HTTP client (30s default).
- Close response bodies with
defer resp.Body.Close().
Webhook Handling
- Verify signatures — HMAC-SHA256 with timing-safe
hmac.Equal. Read raw body withio.ReadAllbefore parsing. - Return 200 on parse errors — prevents the external service from retrying malformed events indefinitely.
- Return 500 on handler errors — signals the external service to retry.
- Register on public route group — webhooks don't have JWT auth, they use their own signature verification.
- Exclude from gzip middleware — webhook bodies need to be read raw for signature verification.
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 3mo ago First seen · 68 lines · 0 tokens per session scan A 591f2687ef8a
external-api is a cursor rule published in the GitHub repository golid-ai/golid (41 stars, last pushed 5mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 604 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
external-api compared with cursor rules from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| external-apigolid-ai/golid | Cursor rule | 41 | 5mo ago | MIT | A | 0 | Cursor |
| backend0xJacky/nginx-ui | Cursor rule | 12k | today | AGPL-3.0 | A | 441 | Cursor |
| cursor_rulesparvez3019/go-swagger3 | Cursor rule | 154 | 2d ago | MIT | A | 0 | Cursor |
| windmill-overviewwindmill-labs/windmill | Cursor rule | 19k | today | none | A | 0 | Cursor |
| server-actionskrivoox/agent-stack-template | Cursor rule | 30 | 2mo ago | MIT | A | 0 | Cursor |
| cursor-rule-templatesingchia/gospec | Cursor rule | 7 | 7mo ago | MIT | A | 0 | Cursor |
| ponytailDietrichGebert/ponytail | Cursor rule | 204k | 12d ago | MIT | A | 604 | Cursor |