ai-actions-api-docs

A set of rules for connecting an AI Action to a third-party service through its API, the interface software uses to communicate. It requires checking the service's official documentation and keeping credentials in secure configuration.

In plain words
What is it for?
Use it when building an AI Actions integration: find the official API details, confirm authentication and request formats, then implement secure credential handling.
Why use it?
It prevents implementations based on guessed API details or exposed passwords and keys. The integration must be verified before code is written.

Cursor rule

Install

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.

agentmods
npx agentmods add rules/freshworks-developers/fw-dev-tools/ai-actions-api-docs
Clone the repo
git clone --depth 1 https://github.com/freshworks-developers/fw-dev-tools
Per session 0 Nothing until a file matches its globs; then the whole rule loads.
When invoked 725 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

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.

ModelPer sessionOnce invoked
Fable 5 $0.00000 $0.00725
Opus 5 $0.00000 $0.00362
Sonnet 5 $0.00000 $0.00145
Haiku 4.5 $0.00000 $0.00072

Measured 2d ago against content hash dcd9e100fec8, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

ai-actions-api-docs 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 2d 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.

skills/fw-ai-actions-app/rules/ai-actions-api-docs.mdc · 78 lines

How it starts

The opening of the file, as written. The whole thing — 78 lines — stays where its author put it; the contents beside it link to each section on GitHub.

AI Actions - API Documentation Requirements

Core Rules (credentials)

NEVER hardcode API keys, tokens, credentials, or secrets directly in server.js, actions.json, request templates, README examples, or any other file in the app. ALL credentials must go through installation parameters (iparams) with secure: true where the platform supports it, or through OAuth / platform-supported auth configuration—not through literals in source.

🚨 BLOCKING RULE — 100% STRICT

AI Actions exist. When an action integrates with a third-party API, third-party docs API search is MANDATORY.

Implementation is FORBIDDEN until official documentation is found via web search.

Mandatory Steps (No Exceptions)

  1. SEARCH — Use web_search to find official API docs (e.g. "Stripe API create customer", "HubSpot API authentication")
  2. FETCH — Use mcp_web_fetch to load the docs URL and extract:
    • Base URL / host
    • Path and HTTP method
    • Authentication (OAuth, Bearer, API key, Basic)
    • Required headers
    • Request body structure
    • Response format
  3. CITE — Reference the docs URL in your response
  4. IMPLEMENT — Only after steps 1–3. Code must match the fetched docs exactly.

Authentication Best Practices

For Basic Authentication:

  • ✅ Use the encode() platform function in request templates for Base64 encoding
  • ✅ Example: "Authorization": "Basic <%= encode(iparam.api_key) %>"
  • ✅ The encode() function automatically Base64-encodes the value (e.g., APIKEY:X format)
  • ❌ Never manually Base64-encode in server.js when request templates support encode()

Example request template with Basic auth:

{
  "getResource": {
    "schema": {
      "method": "GET",
      "host": "<%= iparam.domain %>",
      "path": "/api/v2/resource",
      "headers": {
        "Authorization": "Basic <%= encode(iparam.api_key) %>",
        "Content-Type": "application/json"
      }
    }
  }
}

If Docs Cannot Be Found

Read the full file on GitHub · 78 lines

Changes

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.

  1. 2d ago First seen · 78 lines · 0 tokens per session scan A dcd9e100fec8

Subscribe to this mod's changes

ai-actions-api-docs is a cursor rule published in the GitHub repository freshworks-developers/fw-dev-tools (5 stars, last pushed 8d ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 725 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-31.