Skip to main content

API and MCP

Your node offers access for your own scripts and AI agents: a REST API and an MCP server. Both run on the node itself, use the same tokens and show the same data as the console. They read, and the MCP server can also check your coverage, propose decoys and draft deployments. With the write scope, a token can also handle alerts the way an analyst does: acknowledge, resolve, reopen and annotate them, and triage events. Nothing they expose can switch detection off or change settings. An agent deploys decoys only if you allow it: with the propose scope it files a deployment request that an administrator approves or rejects in the console, and with the deploy scope (personal tokens only) it deploys them right away (see What the API can never do). They come with both editions.

In Sugardaddy Community there are no alerts, monthly report or mobile app, so the tools and resources for them are not there: no list_alerts, get_alert or get_report, and with the write scope a token can only triage events. Events come without a MITRE ATT&CK technique (attack is null) and without known sources.

Create a token​

  1. Sign in to the console with your own account. You need the Administrator role.
  2. Open Settings → API → New token.
  3. Give it a name that says who uses it (for example SOC agent) and choose when it expires: in 30, 90 or 365 days, or never. If you signed in with Microsoft Entra ID, the token must expire within 90 days.
  4. Every token has the read scope. Tick Propose deployments (with approval) only if the agent should be able to file deployment requests (see Deployment requests), and Write: handle alerts only if it should acknowledge, resolve, reopen and annotate alerts and triage events (see Handling alerts). Tick Deploy decoys without approval only if the agent should deploy decoys itself, with no one approving first (see Deploying without approval): the token must then expire within 90 days.
  5. Click Create token and copy it. It is shown only once: the node keeps only a fingerprint of it. Store it in your secrets manager.

Each person can have up to 10 active personal tokens. There are four scopes:

  • read, which every token has: sensors, decoys, alerts, events and coverage, and the MCP tools that check coverage, propose decoys and draft deployments without saving anything;
  • propose, which you add when you create the token: it also lets the agent file deployment requests. A request deploys nothing on its own;
  • write, which you add when you create the token: it also lets the token handle alerts and triage events, and nothing else;
  • deploy, which you add when you create a personal token: it also lets the agent deploy decoys right away, without approval. It only adds decoys.

Only administrators create tokens, so only administrators can give the propose, write and deploy scopes.

To give an agent less than a whole scope, tick Limit to some tools when you create the token and choose the MCP tools it may use. The MCP server shows it only those tools, and every REST resource counts as its tool (GET /alerts is list_alerts, POST /alerts/<id>/resolve is resolve_alert): any other answers 403 (tool_not_allowed). GET /api/v1 always works. Without the box ticked, the token reaches every tool of its scope, also those added later. The list cannot be changed afterwards: create another token.

A personal token belongs to the person who creates it. For an integration that must keep working when that person changes role or leaves, such as a SIEM or a SOAR, use a service account instead.

The list of tokens shows the scope of each one. A token works with the permissions of the administrator who created it, and this is checked on every request.

If its creator has a local account (username and password on the node), the token stops working when:

  • it expires or someone revokes it;
  • its creator is removed, their password is reset or they are no longer an administrator: in these three cases the token is also revoked for good, and it does not come back if the person becomes an administrator again;
  • local sign-in is turned off on the node.

If its creator signs in with Microsoft Entra ID, the node cannot ask Entra whether the account is still active, so it relies on that person's sign-ins to this console. The token stops working when:

  • it expires (always within 90 days) or someone revokes it;
  • the creator's last sign-in to this console is more than 7 days old: a disabled Entra account keeps its tokens for 7 days at most;
  • the creator's last sign-in was no longer as an administrator (if Entra removes the role, the token stops working on their next sign-in).

The list in Settings → API → Personal tokens shows each creator's last sign-in, and moves a token whose creator no longer qualifies to Not valid, with the reason. Emergency, support and development sessions cannot create tokens.

Revoke a token​

Open Settings → API → Personal tokens and click Revoke. The next request with that token is refused. Any administrator can revoke any token. Tokens that are not valid, revoked or expired stay in the list, with who revoked them and when.

Service accounts​

A service account is a token that belongs to the node, not to a person. Use it for a SIEM, a SOAR or any other integration that must not stop working because the administrator who set it up leaves or loses the administrator role.

To create one, open Settings → API → New service account (you need the Administrator role and your own account):

  1. Give it a name that says what uses it (for example Sentinel playbooks). Two active service accounts cannot have the same name.
  2. Choose its scopes: read always, write and propose if needed.
  3. Choose when it expires: in 30 or 90 days (the default). A service account always expires, within 90 days, and it cannot be extended: before it expires, create a new one and replace the secret in the integration.
  4. Optionally, list the source addresses it may be used from: up to 20 IP addresses or CIDR networks (0.0.0.0/0 is not allowed). A request from any other address is refused with 403 (address_not_allowed), recorded in the audit log and counted as a failed attempt. The address is the one the console sees, taken from the node's own reverse proxy, never from a header the client writes. Leave it empty to allow any address.
  5. Click Create service account and copy the secret: it is shown only once.

Compared with a personal token:

  • it is not checked against a person on every request. It still depends on one administrator, shown as Depends on: the one who created it or, once another administrator rotates it, the one who rotated it last. If that person (a local account) is removed, loses the administrator role, or has their password reset or recovered with a code, the service account is revoked. To keep an integration working when someone leaves, have another administrator rotate its service account first;
  • any administrator sees it in Settings → API → Service accounts, with who created it, who it depends on, when it was created, when it was last used and from which address, and can revoke or rotate it;
  • creating, rotating and revoking one are recorded in the audit log as high-severity API token events (auditoria.token-api), which reach the outputs and SIEM that receive audit events, so every administrator who follows them hears about it;
  • a node can have at most 20 active service accounts;
  • everything it does is recorded in the audit log as service account <name>, and alerts it acknowledges or notes it adds show that name in the console;
  • its fingerprint is stored in a form that versions before this one do not recognise: if the node goes back to an earlier version, service accounts stop working instead of running without their limits.

The Service accounts tab warns about any service account that expires within 7 days, and its tab title shows how many.

Rotate a service account​

Rotate gives the service account a new secret, shown once, and keeps its name, scopes, addresses and expiry date. The administrator who rotates it becomes the one it depends on. Choose what happens to the previous secret:

  • Old secret stops now (the default): use it whenever you are not sure the old secret is safe;
  • Old secret works 24 h more: both work for 24 hours, so you can update the integration without an outage.

Rotating again within the 24 hours ends the oldest secret at once: there is at most one previous secret. If two administrators rotate the same service account at the same moment, only one succeeds and the other is told to check the list. Rotations are recorded in the audit log.

Revoke all API access​

For an emergency, such as a leaked secret you cannot identify, open Settings → API → Revoke all, type REVOKE and confirm. Every personal token and every service account of the node stops working at once, and pending deployment requests are rejected. It cannot be undone, and console sign-in is not affected.

Limits and audit​

  • Each token can make 120 requests per minute. Above that, the node answers 429 with a Retry-After header.
  • Writes have their own, lower limit: 30 writes per minute per token, on top of the general one.
  • Every request made with a token is recorded in the audit log: which token, what was asked, the result and the address it came from. The token itself is never recorded. Every write also leaves an API write line with the action and the alert or event it changed.
  • The API only accepts the Authorization: Bearer header: it never uses the console's session cookie.
  • If access to the console is limited to a list of addresses (Settings → Access), the machine that calls the API must be on that list.

REST API​

Base address: https://<your console>/api/v1. Send the token in the Authorization: Bearer <token> header.

ResourceWhat it returns
GET /sensorsSensors with their status (online, offline, degraded, retired) and last heartbeat
GET /sensors/<id>The health of one sensor: why it is degraded, versions, warnings
GET /decoysDecoys with their sensor, environment and status. ?sensor=<id> filters by sensor
GET /alertsAlerts. Filters: status (open, closed), min_severity, since, limit
GET /alerts/<id>One alert with its latest events (see below)
GET /eventsEvents in the event contract v1. Filters below
GET /events/<id>One event in the event contract v1
GET /coverageDecoys per sensor, environment and type, and which are still unverified
GET /placementsThe placement inventory. ?decoy=<id>, ?state=open or ?state=closed (see below)
GET /decoys/<id>One decoy with its sensor, status and events, without its settings (they hold the bait credentials)
GET /statsEvent counts by day, severity, type, ATT&CK technique, decoy and source. since, until (30 days by default, 365 at most), decoy and include_benign
GET /reports/monthlyThe monthly report of Reports, as JSON. ?month=YYYY-MM (the current month by default)
GET /ips/<ip>What the node knows about an address: location, Tor, known source, lists, events, decoys touched and alerts
GET /targetsThe places where decoys can be deployed
GET /catalogEvery decoy in the catalog with its card and whether this node can deploy it, or why not

With the write scope (see Handling alerts):

RequestBody (JSON)What it does
POST /alerts/<id>/acknowledgeoptional noteMarks the alert as being handled
POST /alerts/<id>/resolveoptional noteCloses the alert
POST /alerts/<id>/reopenoptional noteReopens an alert closed in the last 30 days
POST /alerts/<id>/notestext (1 to 2,000 characters)Adds a note to the alert
PUT /events/<id>/triagestatus (reviewed, false_positive, interesting), noteSets or changes the triage label of the event
DELETE /events/<id>/triagenoneRemoves the triage label

A write body is a JSON object (Content-Type: application/json) of up to 8 KB with only the fields listed: an unknown field, a value that is not a string or a body that is not JSON is refused with 400. Without the write scope every write answers 403 (insufficient_scope). GET /api/v1 lists the write requests only to a token that has the scope.

/events filters: since and until (ISO 8601), min_severity, decoy (a decoy id), include_benign=true (also tests and known scanners) and limit (1 to 200). The fields, the vocabularies and the version policy are in Event contract v1.

GET /alerts/<id> returns the alert's latest events (up to 50) twice: event_list, in its original shape, which does not change, and event_list_v1, the same events in the event contract v1, as /events returns them, with event_schema saying which version. New integrations should read event_list_v1.

/placements lists every copy of a bait file or credential placed somewhere (a folder, a file server, SharePoint, OneDrive): its exact location, web_url when it has one, the template_version it was minted with, its sha256, status (pending, placed, removing, missing, removed, replaced), placed_at, last_seen_at, expires_at, rotation_days, rotate_at, replaces and, once removed, removed_at and removed_by (user, expired, rotated, decoy_removed). Removed placements stay as history (the latest 500). The same inventory downloads as CSV, with the same column names, from Honeypots → Placements → Export CSV in the console.

Answers are JSON with the version ({ "api_version": "1", "data": ... }). Errors have the form { "error": { "code": ..., "message": ... } }.

curl -H "Authorization: Bearer $SUGARDADDY_TOKEN" \
"https://<your console>/api/v1/alerts?status=open&min_severity=high"

MCP server​

Address: https://<your console>/api/mcp, with the same token. It follows the MCP "streamable HTTP" transport. Each request carries one message: JSON-RPC batches are rejected.

ToolWhat it does
list_sensorsSensors with their status and last heartbeat
sensor_healthThe health of one sensor
list_alertsAlerts, with the same filters as the REST API
get_alertOne alert with its latest events, in both shapes (event_list and event_list_v1)
list_eventsEvents in the event contract v1, with the same filters as /events
list_artifactsDecoys with their sensor, environment and status
get_decoyOne decoy, as /decoys/<id>
event_statsEvent counts, as /stats
get_reportThe monthly report, as /reports/monthly
lookup_ipWhat the node knows about an address, as /ips/<ip>
list_targetsThe places where decoys can be deployed
list_catalogThe decoy catalog and what this node can deploy
list_placementsThe placement inventory, as /placements
coverage_reportDecoys per sensor, environment and type, and which are still unverified
validate_coverageCompares your coverage with what attackers touched in the last N days (services, ports, environments) and lists the gaps
propose_artifactDecoys from your catalog that fit a goal or a sensor, with the reasons for each
draft_deploymentBuilds and checks a deployment draft, exactly as the console would, without saving it
request_approvalOnly with the propose scope: files the draft as a request for an administrator to approve
deploy_decoysOnly with the deploy scope: deploys the draft right away, checked again, without approval
acknowledge_alertOnly with the write scope: marks an open alert as being handled, with an optional note
resolve_alertOnly with the write scope: closes an alert, with an optional note
reopen_alertOnly with the write scope: reopens an alert closed in the last 30 days, at most 3 times a day
add_alert_noteOnly with the write scope: adds a note to an alert
triage_eventOnly with the write scope: sets (reviewed, false_positive, interesting) or removes (untriaged) a triage label, never one set by the node

All of them except request_approval, deploy_decoys and the write tools only read. A token without the scope does not even see those tools in tools/list. Settings → API → Connect a client shows the exact address of your node and the configuration for each tested client.

Claude Code:

claude mcp add --transport http sugardaddy https://<your console>/api/mcp \
--header "Authorization: Bearer $SUGARDADDY_TOKEN"

Codex (the token is read from the variable each time Codex starts, never stored in its configuration):

codex mcp add sugardaddy --url https://<your console>/api/mcp \
--bearer-token-env-var SUGARDADDY_TOKEN

Any client built with the official MCP TypeScript SDK connects with StreamableHTTPClientTransport and the same header.

Handling alerts (write scope)​

With the write scope, a token works on alerts as an analyst would in the console, with the same checks and the same audit:

  • Acknowledge ("I'm on it"): an open alert stops being escalated. Alerts about new activity of that source keep arriving, and if the source then does something more serious (a bait credential, an internal honeypot, a higher severity), the acknowledgement is dropped and the alert notifies again as if it had just opened. If someone already handled it, nothing changes. A closed alert must be reopened first (409).
  • Resolve: closes the alert, as when it closes on its own after 48 hours without activity, and sends the same closing summary (at most once a day per alert when it is closed through the API). It does not silence the source: if it comes back, a new alert opens and notifies again. Resolving a closed alert changes nothing.
  • Reopen: an alert closed in the last 30 days opens again, unless its source already has another open alert (409), and at most 3 times in 24 hours (429). Nobody is handling it afterwards: the previous acknowledgement is dropped, it notifies as "Incident reopened by " and escalates again if nobody responds. Reopening through the API does not reset its escalation count. It closes again after 48 hours without activity. Reopening an open alert changes nothing.
  • Notes: up to 2,000 characters each, and up to 200 per alert. Notes cannot be edited or deleted. GET /alerts/<id> returns them in notes, with the text and the author inside untrusted (they may have been written by an agent).
  • Event triage: the same labels as Events in the console (reviewed, false positive, interesting), with an optional note. A label does not change detection or alerting. The API cannot change or remove a label set by the node itself (pentest mode, known sources, automatic triage rules): that answers 409. A false positive set through the API is only a label: it does not remove the event from the threat intelligence the node shares, which only a false positive set by a person in the console does.

The console shows who did it: API: <token name> for a personal token and service account <name> for a service account. The API returns that name inside untrusted (handled_by), because a token name is chosen by a person. In the console, the same actions are in Incidents (they need the Operator or Administrator role) and in Events.

Every answer includes the alert as it is after the change, and changed says whether anything changed (false when it was already in that state).

What the API can never do​

Whatever its scope, a token or service account cannot:

  • silence sources, add known sources or change any list;
  • stop, pause, remove or change decoys or sensors;
  • change settings: thresholds, escalation, outputs, access, users or the API itself;
  • run responses or actuators: blocking addresses, blocklists, firewalls;
  • deploy anything, unless it is a personal token with the deploy scope (Deploying without approval): otherwise deploying only happens when an administrator approves a deployment request in the console;
  • approve its own requests, create tokens or rotate service accounts.

So a stolen token can, at worst, mark alerts as handled or closed, and a stolen deploy token can also add decoys, each one recorded in the audit log. It cannot switch detection off: new activity still opens alerts and notifies, anything more serious drops an acknowledgement, reopening notifies, and every write is in the audit log under that token, even when it fails.

The address the API checks is the one the node's reverse proxy writes. The console cannot yet tell the proxy apart from other containers of the node itself, so a source-address list protects against the outside world, not against something already running inside the node.

Deployment requests​

An agent can analyse your alerts, compare them with your coverage and propose decoys. Unless its token has the deploy scope, it never deploys anything. The flow is:

  1. validate_coverage and propose_artifact say what is missing and what fits where: only decoys in your subscription and license, on targets where they can be deployed, with free ports, and not already there. The goal is read by concept, not word for word: plurals and simple word forms match, filler such as "detect attackers" is ignored, and each concept brings its synonyms ("databases" also finds MySQL, PostgreSQL, MongoDB, Redis, memcached or Elasticsearch decoys; "admin panels" also finds consoles, dashboards and login portals). Each module is matched by its name, description, what it detects, where it goes, its templates and the services of its ports. The answer lists the keywords and concepts it understood.
  2. draft_deployment builds a draft (up to 10 decoys: module, sensor or target, name, settings, listen address) and checks it with the same rules as deploying from Honeypots. It saves nothing. On a machine with several addresses, a decoy without listen_address gets its own free address, exactly as when you deploy a template from the console (one address per decoy); the draft shows the address and says it was chosen by the console. If no address is free for its ports, the draft warns that it would listen on all addresses.
  3. With a propose token, request_approval saves the draft, checked again, as a pending request with the agent's reason. Requests expire after 7 days, and a token can have at most 20 pending.
  4. The console shows a notice and a counter on Settings. In Settings → API → Requests an administrator sees each request in full: who asked (the token and its creator), when, the reason, and exactly what would be deployed (module, target, sensor, listen address, ports, settings), checked again at that moment, with a warning if another decoy has taken that address since.
  5. Approve and deploy checks everything once more (the catalog, the license, the sensor or the ports may have changed) and deploys each decoy exactly as if the administrator had deployed it from Honeypots, under their name in the audit log. Reject discards it.

A request that has expired, was rejected or was already applied cannot be approved. Revoking a token rejects its pending requests, and so does removing its creator, resetting their password or removing their administrator role. Each decoy is deployed on its own: if one fails at that moment, the others stay deployed and the request shows as Partly applied, with the result of each one. A token can never approve a request, whatever its scope. Filing, approving and rejecting are recorded in the audit log.

The reason and the goal are written by the agent, and an agent may have read text written by an attacker. The console shows them apart, marked as written by an agent, as plain text, trimmed and without invisible characters. A request only carries what you would type when deploying a decoy: module, target, name, listen address and settings checked against the module, never commands. Every setting is shown in full before you approve (long ones folded). A request from an agent only deploys decoys that run on a sensor, never HTML pages or settings of several lines, and no value can hide invisible characters: decoys deployed by hand, and HTML, are set up by a person from Honeypots. The guided tools, event_stats and get_report allow 10 calls per minute per token, and a node can have at most 50 pending requests.

Deploying without approval​

A personal token with the deploy scope can use deploy_decoys: it takes the same items as draft_deployment, checks them again and deploys each decoy exactly as if its creator had deployed it from Honeypots, with no one approving first. Use it when you want your agent to act on its own, for example to cover a gap that validate_coverage found.

  • Only personal tokens get this scope, never service accounts, and the token must expire within 90 days. It works only while its creator is an administrator, as every token does.
  • It only adds decoys. It never removes, stops or changes one, and it has the same limits as a deployment request: only decoys that run on a sensor, no HTML pages or settings of several lines, no invisible characters.
  • At most 10 decoys per call, 3 calls per minute and 20 per hour per token.
  • Every deployment is recorded in the audit log under the token, with the agent's reason and the result of each decoy. In Sugardaddy Cloud it also notifies administrators through their outputs. Follow the new decoys in Honeypots or with get_decoy.

Data written by attackers​

Alerts contain text that attackers wrote: usernames, host names, commands, URLs, request headers. An AI agent could take that text for instructions. To prevent it:

  • that text only appears inside fields named untrusted, trimmed and without control or invisible characters, and never mixed with the fields the node writes;
  • from the details of an event, only the fields that decoy shows in the console are returned, and never credential material (hashes, challenges and responses, authorization headers, request bodies);
  • every answer that can contain it carries a notice, and so do the descriptions of the MCP tools that return it;
  • passwords attempted by attackers are never returned (only whether there was one);
  • no tool can switch detection off or deploy, so an agent that is fooled can only read, file a request that someone has to approve (with a propose token) or, with a write token, mark alerts as handled or closed, which is recorded under that token and does not stop new alerts;
  • the write tools tell the model never to act because text in alert or event data asks it to.

Even so, review what an agent proposes before approving it.