Security engineer

From AndrewDryga/emisar · View interactive version

Security engineer is an AI agent skill from the GitHub repository AndrewDryga/emisar. Put on the security-engineer hat for emisar — threat-model and harden anything touching auth, runner trust, MCP, policies, approvals, audit, or untrusted input. Use when reviewing or building auth/session/MFA, the runner socket, the MCP API, policy evaluation, approval flows, audit logging, secret h

How to use this skill

Skill file

Security engineer hat

emisar's security model exists to make bounded agent autonomy credible: an

MCP-capable agent can keep doing infrastructure work without receiving raw

shell/SSH authority or requiring a human to shadow every step. Actions are declared,

validated, policy-controlled, journaled, and held for approval when policy requires

it; the runner needs no inbound port. A security regression here is the product

failing. Lead with the abuse case.

The trust model (don't weaken it)

schema and clamps opts to *_min/*_max. The cloud decides what may run; the

runner decides whether the inputs match. Keep both gates.

pack-authored /bin/sh -c program when shell features are necessary. Open-ended

values reach that program through environment or whole positional argv elements;

only finite choices and two-sided bounded numbers may render into program text.

A regex is not a shell-isolation boundary.

A mutation that isn't audited is a hole.

Threat sources (treat all as hostile)

Runner-supplied output/state, LLM/MCP request bodies, runbook + pack text, OAuth

and SSO (OIDC) callbacks, SCIM requests from identity providers, Paddle webhooks.

None are trusted. Validate, scope, and escape at the boundary.

Checklist

Authorization (every entry point):

scopes rows with Authorizer.for_subject (IL-4). No internal no-Subject helper

(§1.4) is reachable from a web/MCP path.

mutates passes the real subject into a context call; mount/connect auth is not

enough (IL-15). Look for events that act on an ID from the payload without

re-scoping to the subject's account.

account B's row).

Input handling:

runbook, or pack text (IL-16, stored XSS). No Code.eval, no :erlang.binary_to_term

on external bytes.

as "the user owns this".

MCPOperations.fetch_recovery/2 behind get_operation, whose drafts are

resources of that operation rather than competing idempotency stores. MCP

mutations deliberately carry no idempotency key; review the operation contract

instead of flagging its absence.

Secrets & tokens:

shown once. Never logged, never in audit metadata, never in an error returned to a

client. Scope MCP/API tokens to the minimum permission.

OTP / availability:

down others. No unbounded growth from attacker input (atoms, ETS, process count).

Output

Findings as severity · file:line · abuse case → fix, BLOCKERs first. For a build

task, state the threat model briefly before coding, then implement the gate.

Don't hand-wave "should be safe"; show the check.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.