armor-agent-plugin 6.0.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of armor-agent-plugin might be problematic. Click here for more details.
- armor/__init__.py +9 -0
- armor/__main__.py +3 -0
- armor/cli.py +209 -0
- armor/data/ai_standards/_catalog/latest.json +7 -0
- armor/data/ai_standards/_catalog/versions/2026-05-14__b1ed6db3/guardrail_catalog.json +1517 -0
- armor/data/ai_standards/_catalog/versions/2026-05-14__b1ed6db3/guardrail_catalog.md +345 -0
- armor/data/ai_standards/_catalog/versions/2026-05-14__b1ed6db3/guardrail_matrix.csv +54 -0
- armor/data/ai_standards/_catalog/versions/2026-05-14__b1ed6db3/guardrail_matrix.json +1446 -0
- armor/data/ai_standards/_catalog/versions/2026-05-14__b1ed6db3/guardrail_matrix.md +57 -0
- armor/data/ai_standards/_catalog/versions/2026-05-14__b1ed6db3/manifest.json +29 -0
- armor/data/ai_standards/_catalog/versions/2026-05-14__b1ed6db3/source_coverage.json +360 -0
- armor/data/ai_standards/eu-ai-act/history.jsonl +1 -0
- armor/data/ai_standards/eu-ai-act/latest.json +7 -0
- armor/data/ai_standards/eu-ai-act/versions/2026-06-04__e1a1c700/manifest.json +5 -0
- armor/data/ai_standards/mitre-atlas/history.jsonl +1 -0
- armor/data/ai_standards/mitre-atlas/latest.json +7 -0
- armor/data/ai_standards/mitre-atlas/versions/2026-06-04__32346fb3/manifest.json +5 -0
- armor/data/ai_standards/nist-ai-rmf/history.jsonl +1 -0
- armor/data/ai_standards/nist-ai-rmf/latest.json +7 -0
- armor/data/ai_standards/nist-ai-rmf/versions/2026-06-04__b157a100/manifest.json +5 -0
- armor/data/ai_standards/owasp-llm-top10/history.jsonl +1 -0
- armor/data/ai_standards/owasp-llm-top10/latest.json +7 -0
- armor/data/ai_standards/owasp-llm-top10/versions/2026-06-04__0a592025/manifest.json +5 -0
- armor/file_lock.py +114 -0
- armor/pipeline/__init__.py +17 -0
- armor/pipeline/adversary.py +140 -0
- armor/pipeline/conform.py +259 -0
- armor/pipeline/conform_audit.py +192 -0
- armor/pipeline/load.py +94 -0
- armor/pipeline/report.py +357 -0
- armor/pipeline/schema.py +113 -0
- armor/pipeline/schemas/posture_report.schema.json +400 -0
- armor/pipeline/state.py +182 -0
- armor/pipeline/triage.py +225 -0
- armor/pipeline/triage_audit.py +153 -0
- armor_agent_plugin-6.0.0.dist-info/METADATA +574 -0
- armor_agent_plugin-6.0.0.dist-info/RECORD +50 -0
- armor_agent_plugin-6.0.0.dist-info/WHEEL +5 -0
- armor_agent_plugin-6.0.0.dist-info/entry_points.txt +2 -0
- armor_agent_plugin-6.0.0.dist-info/licenses/LICENSE +21 -0
- armor_agent_plugin-6.0.0.dist-info/top_level.txt +2 -0
- catalog/__init__.py +1 -0
- catalog/ai_standards_versioning.py +114 -0
- catalog/download_aiid_slim.py +90 -0
- catalog/download_eu_ai_act_cellar.py +86 -0
- catalog/download_mitre_atlas.py +78 -0
- catalog/download_nist_ai_rmf.py +77 -0
- catalog/download_owasp_llm_top10.py +71 -0
- catalog/generate_guardrail_catalog.py +990 -0
- catalog/refresh_catalog.py +77 -0
armor/__init__.py
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"""ARMOR v6 — LLM-driven AI-guardrail posture pipeline.
|
|
2
|
+
|
|
3
|
+
6-phase pipeline (load -> triage -> triage-audit -> conform -> conform-audit -> report)
|
|
4
|
+
auditing a codebase against a 53-row catalog of AI/agentic standards with citation
|
|
5
|
+
cross-verification and adversarial red-team loops. No internal LLM calls: the calling
|
|
6
|
+
agent (Copilot/Claude) IS the LLM via a disk-queue exchange.
|
|
7
|
+
"""
|
|
8
|
+
|
|
9
|
+
__version__ = "6.0.0"
|
armor/__main__.py
ADDED
armor/cli.py
ADDED
|
@@ -0,0 +1,209 @@
|
|
|
1
|
+
"""CLI dispatcher for the ARMOR v6 posture pipeline."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
import argparse
|
|
6
|
+
import json
|
|
7
|
+
from pathlib import Path
|
|
8
|
+
import sys
|
|
9
|
+
from typing import Any
|
|
10
|
+
|
|
11
|
+
from . import __version__
|
|
12
|
+
from .pipeline import (
|
|
13
|
+
PHASES,
|
|
14
|
+
RunDir,
|
|
15
|
+
conform as conform_mod,
|
|
16
|
+
conform_audit as conform_audit_mod,
|
|
17
|
+
current_run,
|
|
18
|
+
load as load_mod,
|
|
19
|
+
new_run,
|
|
20
|
+
report as report_mod,
|
|
21
|
+
schema as schema_mod,
|
|
22
|
+
triage as triage_mod,
|
|
23
|
+
triage_audit as triage_audit_mod,
|
|
24
|
+
)
|
|
25
|
+
|
|
26
|
+
_PHASE_KIND: dict[str, str] = {
|
|
27
|
+
"load": "one_shot",
|
|
28
|
+
"report": "one_shot",
|
|
29
|
+
"triage": "two_step",
|
|
30
|
+
"triage-audit": "two_step",
|
|
31
|
+
"conform": "two_step",
|
|
32
|
+
"conform-audit": "two_step",
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
_MODULES: dict[str, Any] = {
|
|
36
|
+
"triage": triage_mod,
|
|
37
|
+
"triage-audit": triage_audit_mod,
|
|
38
|
+
"conform": conform_mod,
|
|
39
|
+
"conform-audit": conform_audit_mod,
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
def _build_parser() -> argparse.ArgumentParser:
|
|
44
|
+
parser = argparse.ArgumentParser(prog="armor", description="ARMOR v6 AI-guardrail posture pipeline")
|
|
45
|
+
parser.add_argument("--version", action="version", version=f"armor {__version__}")
|
|
46
|
+
|
|
47
|
+
subparsers = parser.add_subparsers(dest="subcommand", required=True)
|
|
48
|
+
p_pipe = subparsers.add_parser("pipeline", help="Run or inspect the 6-phase posture pipeline")
|
|
49
|
+
p_pipe.add_argument("project", help="Path to the project under assessment")
|
|
50
|
+
p_pipe.add_argument(
|
|
51
|
+
"--phase",
|
|
52
|
+
choices=list(PHASES),
|
|
53
|
+
help="Run one phase",
|
|
54
|
+
)
|
|
55
|
+
p_pipe.add_argument(
|
|
56
|
+
"--finalize",
|
|
57
|
+
action="store_true",
|
|
58
|
+
help="For two-step phases: consume queue/<phase>.response.json and write the artifact",
|
|
59
|
+
)
|
|
60
|
+
p_pipe.add_argument(
|
|
61
|
+
"--status",
|
|
62
|
+
action="store_true",
|
|
63
|
+
help="Print phase status of the latest run",
|
|
64
|
+
)
|
|
65
|
+
p_pipe.add_argument(
|
|
66
|
+
"--all",
|
|
67
|
+
action="store_true",
|
|
68
|
+
help="Advance every phase runnable without an LLM, then stop at the first request awaiting a response",
|
|
69
|
+
)
|
|
70
|
+
p_pipe.add_argument(
|
|
71
|
+
"--catalog",
|
|
72
|
+
metavar="PATH",
|
|
73
|
+
help="Override the guardrail_matrix.json path (Phase 1)",
|
|
74
|
+
)
|
|
75
|
+
p_pipe.add_argument(
|
|
76
|
+
"--audit-model",
|
|
77
|
+
metavar="NAME",
|
|
78
|
+
help="Reserved, unused (model hint for adversary phases)",
|
|
79
|
+
)
|
|
80
|
+
p_pipe.add_argument(
|
|
81
|
+
"--validate-report",
|
|
82
|
+
action="store_true",
|
|
83
|
+
help="Validate posture_latest.json against the PostureReport schema; exit",
|
|
84
|
+
)
|
|
85
|
+
p_pipe.add_argument(
|
|
86
|
+
"--write-schema",
|
|
87
|
+
action="store_true",
|
|
88
|
+
help="Regenerate armor/pipeline/schemas/posture_report.schema.json from the pydantic models; exit",
|
|
89
|
+
)
|
|
90
|
+
return parser
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
def _run_phase(
|
|
94
|
+
project: Path,
|
|
95
|
+
run: RunDir,
|
|
96
|
+
phase: str,
|
|
97
|
+
finalize: bool = False,
|
|
98
|
+
catalog: str | None = None,
|
|
99
|
+
) -> dict[str, Any]:
|
|
100
|
+
if phase == "load":
|
|
101
|
+
art = load_mod.run(project, catalog_arg=catalog, run_dir=run)
|
|
102
|
+
art_path = run.artifact("load")
|
|
103
|
+
print(f"[load] wrote {art_path} ({art['count']} guardrails)")
|
|
104
|
+
return art
|
|
105
|
+
|
|
106
|
+
if phase == "report":
|
|
107
|
+
art = report_mod.run(project, run_dir=run)
|
|
108
|
+
art_path = run.artifact("report")
|
|
109
|
+
latest_md = project / ".armor" / "reports" / "posture_latest.md"
|
|
110
|
+
print(f"[report] wrote {art_path} and {latest_md}")
|
|
111
|
+
return art
|
|
112
|
+
|
|
113
|
+
mod = _MODULES[phase]
|
|
114
|
+
if not finalize:
|
|
115
|
+
req_path = mod.prepare(project, run)
|
|
116
|
+
resp_path = run.response(phase)
|
|
117
|
+
print(
|
|
118
|
+
f"[{phase}] request written: {req_path}\n"
|
|
119
|
+
f"LLM must write response to: {resp_path}\n"
|
|
120
|
+
f"then run: python skills/armor/scripts/armor_run.py pipeline {project} --phase {phase} --finalize"
|
|
121
|
+
)
|
|
122
|
+
return {"status": "request-written", "request": str(req_path)}
|
|
123
|
+
|
|
124
|
+
res = mod.finalize(project, run)
|
|
125
|
+
if isinstance(res, dict) and res.get("status") == "another-round-required":
|
|
126
|
+
resp_path = run.response(phase)
|
|
127
|
+
print(
|
|
128
|
+
f"[{phase}] auditor requested revisions; new request written. "
|
|
129
|
+
f"Drop a fresh response at {resp_path} and re-run with --finalize."
|
|
130
|
+
)
|
|
131
|
+
return res
|
|
132
|
+
|
|
133
|
+
art_path = run.artifact(phase)
|
|
134
|
+
print(f"[{phase}] wrote {art_path}")
|
|
135
|
+
return res
|
|
136
|
+
|
|
137
|
+
|
|
138
|
+
def _cmd_pipeline(args: argparse.Namespace) -> int:
|
|
139
|
+
project = Path(args.project).resolve()
|
|
140
|
+
if not project.exists():
|
|
141
|
+
print(f"error: project path not found: {project}", file=sys.stderr)
|
|
142
|
+
return 2
|
|
143
|
+
|
|
144
|
+
if args.write_schema:
|
|
145
|
+
out_path = schema_mod.write_schema()
|
|
146
|
+
print(f"wrote schema: {out_path}")
|
|
147
|
+
return 0
|
|
148
|
+
|
|
149
|
+
if args.validate_report:
|
|
150
|
+
report_path = project / ".armor" / "reports" / "posture_latest.json"
|
|
151
|
+
if not report_path.is_file():
|
|
152
|
+
print(f"error: report not found: {report_path}", file=sys.stderr)
|
|
153
|
+
return 2
|
|
154
|
+
try:
|
|
155
|
+
data = json.loads(report_path.read_text(encoding="utf-8"))
|
|
156
|
+
schema_mod.validate_artifact(data)
|
|
157
|
+
except Exception as exc:
|
|
158
|
+
print(f"error: invalid PostureReport at {report_path}: {exc}", file=sys.stderr)
|
|
159
|
+
return 1
|
|
160
|
+
print(f"ok: {report_path} conforms to PostureReport schema")
|
|
161
|
+
return 0
|
|
162
|
+
|
|
163
|
+
if args.status:
|
|
164
|
+
run = current_run(project, create_if_missing=False)
|
|
165
|
+
print(f"run: {run.root}")
|
|
166
|
+
st = run.status()
|
|
167
|
+
for ph in PHASES:
|
|
168
|
+
print(f" {ph:14s} {st[ph]}")
|
|
169
|
+
return 0
|
|
170
|
+
|
|
171
|
+
if args.phase == "load" and not args.finalize:
|
|
172
|
+
run = new_run(project)
|
|
173
|
+
else:
|
|
174
|
+
run = current_run(project)
|
|
175
|
+
|
|
176
|
+
if args.all:
|
|
177
|
+
for ph in PHASES:
|
|
178
|
+
if run.artifact(ph).exists():
|
|
179
|
+
continue
|
|
180
|
+
kind = _PHASE_KIND[ph]
|
|
181
|
+
if kind == "one_shot":
|
|
182
|
+
_run_phase(project, run, ph, finalize=False, catalog=args.catalog)
|
|
183
|
+
else:
|
|
184
|
+
_run_phase(project, run, ph, finalize=False, catalog=args.catalog)
|
|
185
|
+
while True:
|
|
186
|
+
if run.response(ph).exists():
|
|
187
|
+
res = _run_phase(project, run, ph, finalize=True, catalog=args.catalog)
|
|
188
|
+
if isinstance(res, dict) and res.get("status") == "another-round-required":
|
|
189
|
+
continue
|
|
190
|
+
break
|
|
191
|
+
else:
|
|
192
|
+
print(f"[--all] stopped at {ph}: awaiting LLM response at {run.response(ph)}")
|
|
193
|
+
return 0
|
|
194
|
+
return 0
|
|
195
|
+
|
|
196
|
+
if not args.phase:
|
|
197
|
+
print("error: specify --phase <name>, --status, or --all", file=sys.stderr)
|
|
198
|
+
return 2
|
|
199
|
+
|
|
200
|
+
_run_phase(project, run, args.phase, finalize=args.finalize, catalog=args.catalog)
|
|
201
|
+
return 0
|
|
202
|
+
|
|
203
|
+
|
|
204
|
+
def main(argv: list[str] | None = None) -> int:
|
|
205
|
+
parser = _build_parser()
|
|
206
|
+
args = parser.parse_args(argv)
|
|
207
|
+
if args.subcommand == "pipeline":
|
|
208
|
+
return _cmd_pipeline(args)
|
|
209
|
+
return 2
|