STACK
MENU
DOCS / CONTROLS / FLAGGED CONTENT

Flagged content

How content that reaches your agents from outside is scanned, what an agent sees when something is flagged, how you choose between withholding and delivering it, and how you review what was flagged. What the scan is and how well it scores is on Controls.

What is scanned

Everything an agent with an account reads that someone else wrote: received email with its attachments, texts, voicemail, what is said on a call or in a meeting, page text from the browser, output from the workspace, results from paid tools, files on the drive, and what is written to memory.

  • On every account, patterns and decoding look for instructions aimed at an agent.
  • With controls on, a classifier reads the content as well.
  • A finding is a warning or a critical.
  • A finding never blocks the agent itself. It is about the content.

What the agent sees

  • With controls off, the content is delivered with a flag that names the finding.
  • With controls on, the content is withheld by default. The agent gets a notice that something was withheld, with the id of the finding, and not the content.
  • A withheld email keeps its sender and its place in the inbox. Its attachments are kept for you alone.
  • A memory write that is flagged and withheld is refused, and nothing is stored.
  • On a call the agent holds, a flag never ends the call.

Choose withhold or deliver

prompt
Deliver flagged content that is only a warning, but keep withholding criticals.

The client calls stack_set_flagged_content_settings. From code or the terminal:

typescript
await stack.flaggedContent.set({ warning: 'deliver', critical: 'withhold' });
bash
npx @getstackrun/cli flagged-content set --warning deliver --critical withhold
npx @getstackrun/cli flagged-content get
  • You choose for each of the two severities. One you leave out keeps its value.
  • The choice applies while controls are on. With controls off, content is always delivered with its flag.
  • Only the owner or an admin changes it, and it asks for no approval.

Review what was flagged

prompt
What has been flagged for the assistant agent?

The client calls stack_list_security_events. Every account can see this list, with controls on or off.

bash
npx @getstackrun/cli event list --agent agt_123
npx @getstackrun/cli event show <event-id>
npx @getstackrun/cli event resolve <event-id>

# Clear an agent's open warnings in one go.
npx @getstackrun/cli agent dismiss-warnings agt_123
  • An event says which pattern matched and where. It keeps the position of the match, not the sender's words.
  • Resolving marks one event as reviewed. Only the owner can.
  • Dismissing clears an agent's open warnings and notices and hides new ones of the same kinds for a day. A critical is never dismissed this way.
  • From code: stack.securityEvents.list(), .resolve(id) and stack.agents.dismissWarnings(agentId).

Scan something yourself

typescript
const result = await stack.scan.scan({ content: text, context: 'webpage' });
// result.verdict: clean, suspicious or critical

The tool is stack_scan, and from the terminal scan --file <path>. Use it for content your own code fetched before you hand it to an agent. Each scan is one action.

Tune the detectors

bash
npx @getstackrun/cli detector list
npx @getstackrun/cli detector configure <detector-key> --from-file ./config.json
npx @getstackrun/cli detector reset <detector-key>
  • You can add patterns of your own, list known false positives, change a severity, or switch a detector off.
  • Changing a detector needs controls. A change applies at once, with no approval.
  • An agent can only make a detector stricter, and cannot reset one.
  • The tools are stack_upsert_detector_config and stack_reset_detector_config.

Switching a detector off, or listing something as a false positive, removes a signal. It gives an agent no new access.

If an agent is blocked

Flagged content from outside never blocks an agent. An agent you registered to be blocked on a critical finding about its own behaviour stays blocked until you unblock it: agent unblock <agent>, or stack_unblock_agent. Unblocking asks for your approval.

When it is refused

  • 402 CONTROLS_REQUIRED - a detector setting was changed with controls off.
  • 403 FORBIDDEN - an agent, or a member, called a settings or events route.
  • 404 NOT_FOUND - no detector has that key.
  • 403 GOVERNANCE_APPROVAL_REQUIRED - unblocking an agent needs your approval.

Reference

Every detector is described in Detectors. The events are on Security Events.

Flagged content | Docs