AI prompts API

These endpoints return the prompts of the AI prompts page, each as the complete text its Copy prompt button copies, so a tool of your own can hand one to an AI agent, and manage the one-time secrets and AI agent keys the prompts use.

List the prompts

GET /api/ai_prompts/ lists the prompts your account can use, in the order the page shows them. It is a read.

GET /api/ai_prompts/?access=ask
Parameter Meaning
access How much the agent may change: ask (the default) for a yes before each change, or full for every change the task needs. Any other value is a 400. See Ask me first or Full access.
curl -s "https://eyalsec.com/api/ai_prompts/?access=ask" \
  -H "X-API-Key: es2_EXAMPLEKEYdoNotUse0000000000000000000000"
{
  "access": "ask",
  "categories": [
    { "key": "start", "name": "Start here", "blurb": "The whole job in one prompt." }
  ],
  "prompts": [
    { "id": "am-i-secure", "category": "start", "title": "Am I secure? Check everything",
      "summary": "Reads your machines, settings and findings and answers with a verdict and the five things to do next. Changes nothing.",
      "needs": "api", "attests": false,
      "prompt": "You are helping me use EyalSec, ..." }
  ]
}
Field Meaning
id The prompt's name. It is also its place on the page: /scanner/prompts#am-i-secure.
category The key of the entry in categories it is listed under. categories is in display order.
title, summary What the card shows.
needs terminal when the agent must run on the computer the prompt is about, api when your API key is enough.
product The product the prompt is written for, such as python. Left out when it fits every product. A prompt for a product your account does not have is not listed.
attests true when the text states that you own or are authorized to monitor the computer it installs on (see Authorization).
prompt The full text to give the agent. The addresses in it are those of the server you called. Where the one-time secret goes, it reads secret_slot ({SECRET}): replace that with a secret from POST /api/ai_prompts/secret/ before you hand the text over.
secret_slot The marker in each prompt that stands for the one-time secret.

Make a one-time secret

POST /api/ai_prompts/secret/ makes the one-time secret a copied prompt carries. The page calls it each time you click Copy prompt. It is a write, so a read-only key cannot call it.

curl -s -X POST "https://eyalsec.com/api/ai_prompts/secret/" \
  -H "X-API-Key: es2_EXAMPLEKEYdoNotUse0000000000000000000000"
{ "secret": "esp_...", "expires_in": 600, "expires_at": "2026-12-01T10:10:00Z" }

The secret works once, within expires_in seconds. An account holds at most 100 unused secrets; past that the answer is 429 until some expire.

Trade the secret for a key

POST /api/ai_prompts/redeem/ is what the agent calls with the secret. It takes no X-API-Key: the secret is the credential.

curl -s -X POST "https://eyalsec.com/api/ai_prompts/redeem/" \
  -H "Content-Type: application/json" \
  --data '{"secret": "esp_...", "name": "build-01"}'
{ "api_key": "es2_...", "name": "build-01", "key_prefix": "es2_3f9a…", "save_to": "~/.config/eyalsec/api-key" }
Field Meaning
secret The one-time secret from the prompt. A second try, or a try after 10 minutes, answers 401.
name How the agent is listed under AI agents on Settings > API access, usually the computer's hostname.
api_key The agent's own key. It has full access, does not expire, and works wherever an API key does until you revoke it. The prompts tell the agent to save it to save_to, readable by you only.

An account can connect up to 50 agents; past that the answer is 409. Revoke one you no longer use and copy the prompt again.

List and revoke AI agents

GET /api/ai_agents/ lists the connected agents, newest first. It never returns a key, only its start.

{ "agents": [
  { "id": 7, "name": "build-01", "key_prefix": "es2_3f9a…",
    "created_at": "2026-12-01T10:02:11Z", "last_used_at": "2026-12-01T10:05:40Z",
    "last_ip": "203.0.***.***" }
] }

DELETE /api/ai_agents/{id}/ revokes one agent: its key stops working at once, and your own key and the other agents keep working. It answers 204, or 404 when no agent with that id is on your account.

curl -s -X DELETE "https://eyalsec.com/api/ai_agents/7/" \
  -H "X-API-Key: es2_EXAMPLEKEYdoNotUse0000000000000000000000"

Something unclear or missing on this page? Email support@eyalsec.com.

EyalSec Pricing Docs Security Play Security glossary About Contact עברית Login Get started Protect my Python app