Step 3 15 min

Create Policies for Your Agent

Define what your agent can do. Block dangerous actions, escalate uncertain ones.

Policy Types

ALLOW

Let it proceed

BLOCK

Stop it

ESCALATE

Human review

REPORT

Log only

Create an Allow Policy

Allow Policytypescript
await fetch('https://api.mosscomputing.com/v1/policies', {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer ' + access_token,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    subject: 'agt_abc123',
    action: 'allow',
    rules: { match: { intent: ['read', 'respond'] } },
    priority: 100,
  }),
});

Create a Block Policy (PII Protection)

Block SSNs and credit card numbers. Lower priority number = higher priority.

Block PII Policytypescript
await fetch('https://api.mosscomputing.com/v1/policies', {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer ' + access_token,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    subject: 'agt_abc123',
    action: 'block',
    rules: {
      match: {
        pattern: ['\\b\\d{3}-\\d{2}-\\d{4}\\b'],
      },
    },
    priority: 10,
  }),
});

Create an Escalation Policy

Escalation Policytypescript
await fetch('https://api.mosscomputing.com/v1/policies', {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer ' + access_token,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    subject: 'agt_abc123',
    action: 'escalate',
    rules: { match: { intent: 'transfer', amount_gt: 10000 } },
    priority: 50,
    escalation: {
      timeout_hours: 24,
      notify: ['finance@acme.com'],
    },
  }),
});