You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 671d501
Browse filesBrowse the repository at this point in the historyBrowse files
description: 'The Armor context: Claude Code''s `classifier_context` (v1), with `auto_mode.{hard_deny,soft_deny,allow}` rules as strings or `{ id, instructions, threshold? }` objects and `auto_mode.environment` entries as `"Name: value"` strings or `{ name, value }` objects. `threshold` applies when Armor evaluates; when the provider evaluates natively (Anthropic dangerous-tool-use beta) rules are judged at the provider''s own boundary.'
3513
+
example:
3514
+
auto_mode:
3515
+
allow: []
3516
+
environment:
3517
+
- 'Trusted repo: github.com/acme/app'
3518
+
hard_deny: []
3519
+
soft_deny:
3520
+
- id: 'secrets-in-vcs'
3521
+
instructions: 'Staging, committing or pushing a file that holds secrets, including indirectly through git add -A when the tree shows one.'
3522
+
v: 1
3523
+
properties:
3524
+
auto_mode:
3525
+
$ref: '#/components/schemas/ArmorAutoMode'
3526
+
v:
3527
+
enum:
3528
+
- 1
3529
+
type: 'number'
3530
+
required:
3531
+
- 'v'
3532
+
type: 'object'
3533
+
ArmorEnvironmentEntry:
3534
+
properties:
3535
+
name:
3536
+
maxLength: 120
3537
+
minLength: 1
3538
+
type: 'string'
3539
+
value:
3540
+
maxLength: 4000
3541
+
type: 'string'
3542
+
required:
3543
+
- 'name'
3544
+
- 'value'
3545
+
type: 'object'
3546
+
ArmorPlugin:
3547
+
additionalProperties: false
3548
+
description: 'Evaluates every client tool call the model emits against a rule stack (hard-deny, soft-deny, allow) before it reaches the caller. The stack merges the workspace guardrail, this plugin, and any Anthropic `safeguards`; on endpoints that support Anthropic''s `dangerous-tool-use` beta the evaluation is native, elsewhere it is one decisions call per tool call. Evaluation is not billed during the beta. Verdicts are reported as `safeguard_results`.'
3549
+
example:
3550
+
classifier_context:
3551
+
auto_mode:
3552
+
environment:
3553
+
- 'Trusted repo: github.com/acme/app'
3554
+
soft_deny:
3555
+
- id: 'no-migrations-delete'
3556
+
instructions: 'Deleting a file under db/migrations.'
3557
+
v: 1
3558
+
id: 'armor'
3559
+
use_cc_style_default_rules: true
3560
+
properties:
3561
+
classifier_context:
3562
+
$ref: '#/components/schemas/ArmorContext'
3563
+
enabled:
3564
+
description: 'Set to false to disable Armor for this request. Defaults to true.'
3565
+
type: 'boolean'
3566
+
evaluate_native_tools:
3567
+
description: 'Run provider-native server tools (web search, code execution, ...) through the agent loop so Armor evaluates them too. Defaults to false: native passthrough stands and such calls are reported `skipped`.'
3568
+
type: 'boolean'
3569
+
id:
3570
+
enum:
3571
+
- 'armor'
3572
+
type: 'string'
3573
+
mode:
3574
+
description: '`enforce` withholds blocked calls; `audit` evaluates and reports the same verdicts without withholding any calls, regardless of `on_error`. Default `enforce`.'
3575
+
enum:
3576
+
- 'enforce'
3577
+
- 'audit'
3578
+
type: 'string'
3579
+
on_error:
3580
+
description: 'When the classifier cannot answer (timeout, upstream error, context too long) the call is reported `unavailable`; `block` rejects it and `log` releases it. Default `block`.'
3581
+
enum:
3582
+
- 'log'
3583
+
- 'block'
3584
+
type: 'string'
3585
+
output_mode:
3586
+
description: 'How a blocked call reaches the caller. `text` (the default): the call is withheld and an `<openrouter_armor_blocked>` marker stands in assistant text. `custom_item` (Responses API only): the call is withheld and an `openrouter:armor_blocked` output item carries its id, name, arguments and the rule that fired. `claude_code_compatibility` (Messages API only; the default when the request carries a `dangerous_tool_use` safeguard, i.e. the client speaks Claude Code''s protocol): the `tool_use` stays in `content[]` and the verdict is `flagged` in `safeguard_results`, so the client withholds execution and writes the error tool result as under the native classifier. Under `text` and `custom_item` the model received a failure result in the loop and continued in the same request; under `claude_code_compatibility` the turn ends on the flagged call and the model continues on the next request, after the client''s denial.'
3587
+
enum:
3588
+
- 'text'
3589
+
- 'custom_item'
3590
+
- 'claude_code_compatibility'
3591
+
type: 'string'
3592
+
use_cc_style_default_rules:
3593
+
description: 'Prepend Claude Code''s built-in auto-mode rule set (1 hard-deny, 72 soft-deny, 17 allow, 21 environment slots) ahead of every configured rule. Defaults to true on the Anthropic Messages API and false elsewhere.'
3594
+
type: 'boolean'
3595
+
required:
3596
+
- 'id'
3597
+
type: 'object'
3598
+
ArmorRule:
3599
+
properties:
3600
+
id:
3601
+
description: 'Stable id, unique within its source; reported as the deciding rule when it fires.'
3602
+
maxLength: 64
3603
+
minLength: 1
3604
+
pattern: '^[a-z0-9][a-z0-9_-]*$'
3605
+
type: 'string'
3606
+
instructions:
3607
+
description: 'What the rule matches, written for the classifier.'
3608
+
maxLength: 8000
3609
+
minLength: 1
3610
+
type: 'string'
3611
+
name:
3612
+
description: 'Display name shown in verdict explanations; defaults to the id.'
3613
+
maxLength: 120
3614
+
minLength: 1
3615
+
type: 'string'
3616
+
threshold:
3617
+
description: 'Probability at or above which the rule counts as matched. Defaults to 0.6 for hard-deny and soft-deny rules and 0.7 for allow rules (an exception needs stronger evidence to clear a matched soft deny).'
3618
+
format: 'double'
3619
+
type: 'number'
3620
+
required:
3621
+
- 'id'
3622
+
- 'instructions'
3623
+
type: 'object'
3624
+
ArmorSafeguardResult:
3625
+
description: 'The outcome of OpenRouter Armor for each client tool call of the response, keyed by tool-call id, in the same shape Anthropic reports its server-side safeguards.'
3626
+
example:
3627
+
status:
3628
+
tool_uses:
3629
+
call_abc:
3630
+
explanation: '[Data Exfiltration]'
3631
+
outcome: 'flagged'
3632
+
type: 'evaluated'
3633
+
call_def:
3634
+
outcome: 'not_flagged'
3635
+
type: 'evaluated'
3636
+
type: 'available'
3637
+
type: 'dangerous_tool_use'
3638
+
properties:
3639
+
status:
3640
+
properties:
3641
+
tool_uses:
3642
+
additionalProperties:
3643
+
oneOf:
3644
+
- properties:
3645
+
explanation:
3646
+
type: 'string'
3647
+
outcome:
3648
+
enum:
3649
+
- 'flagged'
3650
+
- 'not_flagged'
3651
+
type: 'string'
3652
+
type:
3653
+
enum:
3654
+
- 'evaluated'
3655
+
type: 'string'
3656
+
required:
3657
+
- 'type'
3658
+
- 'outcome'
3659
+
type: 'object'
3660
+
- properties:
3661
+
type:
3662
+
enum:
3663
+
- 'skipped'
3664
+
type: 'string'
3665
+
required:
3666
+
- 'type'
3667
+
type: 'object'
3668
+
- properties:
3669
+
reason:
3670
+
type: 'string'
3671
+
type:
3672
+
enum:
3673
+
- 'unavailable'
3674
+
type: 'string'
3675
+
required:
3676
+
- 'type'
3677
+
- 'reason'
3678
+
type: 'object'
3679
+
type: 'object'
3680
+
type:
3681
+
enum:
3682
+
- 'available'
3683
+
type: 'string'
3684
+
required:
3685
+
- 'type'
3686
+
- 'tool_uses'
3687
+
type: 'object'
3688
+
type:
3689
+
enum:
3690
+
- 'dangerous_tool_use'
3691
+
type: 'string'
3692
+
required:
3693
+
- 'type'
3694
+
- 'status'
3695
+
type: 'object'
3474
3696
AutoBetaRouterPlugin:
3475
3697
example:
3476
3698
allowed_models:
@@ -5473,6 +5695,11 @@ components:
5473
5695
type:
5474
5696
- 'string'
5475
5697
- 'null'
5698
+
safeguard_results:
5699
+
description: 'OpenRouter Armor''s verdict for each client tool call of this response, present whenever Armor evaluated the response (even when nothing was flagged). Independent of the `openrouter_metadata` opt-in.'
description: 'OpenRouter Armor''s verdict for each client tool call of this response, present whenever Armor evaluated the response (even when nothing was flagged). Independent of the `openrouter_metadata` opt-in.'
7921
+
items:
7922
+
$ref: '#/components/schemas/ArmorSafeguardResult'
7923
+
type: 'array'
7690
7924
service_tier:
7691
7925
description: 'The service tier used by the upstream provider for this request'
7692
7926
example: 'default'
@@ -7834,6 +8068,11 @@ components:
7834
8068
type: 'string'
7835
8069
openrouter_metadata:
7836
8070
$ref: '#/components/schemas/OpenRouterMetadata'
8071
+
safeguard_results:
8072
+
description: 'OpenRouter Armor''s verdict for each client tool call of this response, present whenever Armor evaluated the response (even when nothing was flagged). Independent of the `openrouter_metadata` opt-in.'
8073
+
items:
8074
+
$ref: '#/components/schemas/ArmorSafeguardResult'
8075
+
type: 'array'
7837
8076
service_tier:
7838
8077
description: 'The service tier used by the upstream provider for this request'
description: 'OpenRouter Armor''s verdict for each client tool call of this response, present whenever Armor evaluated the response (even when nothing was flagged). Independent of the `openrouter_metadata` opt-in.'
0 commit comments