@cdot65/prisma-airs-cli 5.2.0 → 5.3.0
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.
- package/README.md +5 -5
- package/dist/cli/index.js +29 -21
- package/dist/index.d.ts +2 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -15,8 +15,8 @@
|
|
|
15
15
|
|
|
16
16
|
- **Runtime Scanning** — scan prompts and responses against AIRS security profiles, single or bulk with CSV export
|
|
17
17
|
- **Daily environment report** — `airs runtime report` delivers a read-only AI Runtime Security dashboard as self-contained HTML (default) or Markdown in your working directory, with explicit evidence gaps and configuration review findings
|
|
18
|
-
- **Red Team environment
|
|
19
|
-
- **AI Gateway daily
|
|
18
|
+
- **Red Team environment report** — `airs redteam report` collects seven read-only SDK feeds into private HTML/Markdown deliverables, with source completeness, quota and risk review findings, and independently scoped scan-creation activity
|
|
19
|
+
- **AI Gateway daily report** — `airs aigateway report --workspace dev` collects 25 read-only SDK feeds into private offline HTML/Markdown, with a fixed telemetry window, transaction pagination, error review findings and explicit source completeness
|
|
20
20
|
- **SCM dashboard and sessions** — `runtime dashboard` and `runtime sessions` expose application activity, daily trends, checked pagination and explicit session-to-content drill-down. Legacy `scan-logs query` is **broken/under refactor** and exits with migration guidance; see the [session reference](https://cdot65.github.io/prisma-airs-cli/cli/runtime/sessions/)
|
|
21
21
|
- **Guardrail Optimization** — atomic CLI commands (`create`, `apply`, `eval`, `revert`) for custom topic guardrails, designed for autonomous agent loops (see [`AGENTS.md`](AGENTS.md))
|
|
22
22
|
- **AI Red Teaming** — adversarial scanning with static, dynamic, and custom prompt set attack modes
|
|
@@ -49,7 +49,7 @@ airs doctor
|
|
|
49
49
|
airs runtime scan --profile "my-profile" "Is this prompt safe?"
|
|
50
50
|
airs runtime bulk-scan --profile "my-profile" --file prompts.csv --output-file results.csv --batch-size 25
|
|
51
51
|
|
|
52
|
-
# Daily read-only environment
|
|
52
|
+
# Daily read-only environment report, delivered in the current directory
|
|
53
53
|
airs runtime report
|
|
54
54
|
airs runtime report --output markdown
|
|
55
55
|
|
|
@@ -67,8 +67,8 @@ airs runtime topics revert --profile my-profile --name "Explosives"
|
|
|
67
67
|
airs redteam scan --target <uuid> --name "Full Scan" --type STATIC
|
|
68
68
|
airs redteam report <job-id>
|
|
69
69
|
|
|
70
|
-
# Read-only environment
|
|
71
|
-
airs redteam
|
|
70
|
+
# Read-only environment report (HTML by default; --output markdown also supported)
|
|
71
|
+
airs redteam report --strict
|
|
72
72
|
|
|
73
73
|
# Red team custom target adapters
|
|
74
74
|
airs redteam adapter list --output json
|
package/dist/cli/index.js
CHANGED
|
@@ -4746,23 +4746,23 @@ function parseNonnegativePage(value) {
|
|
|
4746
4746
|
return Number(value);
|
|
4747
4747
|
}
|
|
4748
4748
|
|
|
4749
|
-
// src/cli/commands/aigateway-
|
|
4749
|
+
// src/cli/commands/aigateway-report.ts
|
|
4750
4750
|
import { lstat } from "fs/promises";
|
|
4751
4751
|
import { resolve } from "path";
|
|
4752
4752
|
import { AIGatewayClient as AIGatewayClient3 } from "@cdot65/prisma-airs-sdk";
|
|
4753
4753
|
import { z } from "zod";
|
|
4754
4754
|
import { randomUUID } from "crypto";
|
|
4755
|
-
function
|
|
4756
|
-
const command = aigateway.command("dashboard").description("Generate an AI Gateway environment
|
|
4755
|
+
function registerAiGatewayReportCommand(aigateway) {
|
|
4756
|
+
const command = aigateway.command("report").alias("dashboard").description("Generate an AI Gateway environment report (read-only)").requiredOption("--workspace <ref>", "Workspace slug, UUID, or unique display name").option("--days <n>", "Rolling window in days (default: 1)", "1").option("--start <iso>", "Explicit ISO-8601 start; requires --end").option("--end <iso>", "Explicit ISO-8601 end; requires --start").option("--output <format>", "Deliverable format: html or markdown (default: html)").option(
|
|
4757
4757
|
"--output-file <path>",
|
|
4758
4758
|
"Destination (default: new timestamped file in CWD); - for stdout; never overwrite"
|
|
4759
4759
|
).option("--title <text>", "Report title", "AI Gateway environment report").option("--max-pages <n>", "Page budget per source, 1\u2013100 (50 transactions/page)", "40").option("--strict", "Exit 1 after writing if any source is incomplete").addHelpText(
|
|
4760
4760
|
"after",
|
|
4761
4761
|
examples(
|
|
4762
|
-
"airs aigateway
|
|
4763
|
-
"airs aigateway
|
|
4764
|
-
"airs aigateway
|
|
4765
|
-
"airs aigateway
|
|
4762
|
+
"airs aigateway report --workspace ws-develo-71f8d8 --output-file ./airs-daily.html",
|
|
4763
|
+
"airs aigateway report --workspace ws-develo-71f8d8 --output markdown --output-file ./airs-daily.md",
|
|
4764
|
+
"airs aigateway report --workspace ws-develo-71f8d8",
|
|
4765
|
+
"airs aigateway report --workspace ws-develo-71f8d8 --strict --max-pages 20 --output-file - > daily.html"
|
|
4766
4766
|
)
|
|
4767
4767
|
).action(async (opts) => {
|
|
4768
4768
|
const format = opts.output ?? command.parent?.parent?.opts().output ?? "html";
|
|
@@ -4896,7 +4896,7 @@ function scopeNameLooksUnrelated(name, scopeName) {
|
|
|
4896
4896
|
function registerAiGatewayCommand(program) {
|
|
4897
4897
|
const aigateway = program.command("aigateway").description("Manage and observe Prisma AIRS AI Gateway resources").action(() => aigateway.outputHelp());
|
|
4898
4898
|
registerAiGatewayInventory(aigateway);
|
|
4899
|
-
|
|
4899
|
+
registerAiGatewayReportCommand(aigateway);
|
|
4900
4900
|
registerAiGatewayInference(aigateway);
|
|
4901
4901
|
const workspace = aigateway.command("workspaces").alias("workspace").description("Manage gateway workspaces").action(() => workspace.outputHelp());
|
|
4902
4902
|
const workspaceList = workspace.command("list").description("List workspaces (default: active workspaces you are scoped to)").option("--plane <plane>", "Plane to read from: data (scoped) or admin (whole tenant)").option("--status <status>", "Filter by lifecycle state: active or archived").option("--all", "Merge active + archived admin-plane reads (whole tenant, both states)").option("--output <format>", "Output format: pretty, table, markdown, csv, json, yaml").addHelpText(
|
|
@@ -6291,24 +6291,33 @@ async function backupTargets(opts) {
|
|
|
6291
6291
|
return results;
|
|
6292
6292
|
}
|
|
6293
6293
|
|
|
6294
|
-
// src/cli/commands/redteam-
|
|
6294
|
+
// src/cli/commands/redteam-report.ts
|
|
6295
6295
|
import { lstat as lstat2 } from "fs/promises";
|
|
6296
6296
|
import { resolve as resolve2 } from "path";
|
|
6297
6297
|
import { RedTeamClient } from "@cdot65/prisma-airs-sdk";
|
|
6298
6298
|
import { randomUUID as randomUUID3 } from "crypto";
|
|
6299
|
-
function
|
|
6300
|
-
const command = redteam.command("dashboard").description("Generate
|
|
6299
|
+
function registerRedTeamReportCommand(redteam, scanReport) {
|
|
6300
|
+
const command = redteam.command("report [jobId]").alias("dashboard").description("Generate an environment report, or view an individual scan report by job ID").option("--attacks", "Individual scan only: include attack list", false).option("--severity <level>", "Individual scan only: filter attacks by severity").option("--limit <n>", "Individual scan only: max attacks to show", "20").option("--output <format>", "Deliverable format: html or markdown (default: html)").option(
|
|
6301
6301
|
"--output-file <path>",
|
|
6302
6302
|
"Destination (default: new timestamped file in CWD); - for stdout; never overwrite"
|
|
6303
6303
|
).option("--title <text>", "Report title", "Red Team environment report").option("--max-pages <n>", "Page budget per source, 1\u2013100 (15 records/page)", "40").option("--strict", "Exit 1 after writing if any source is incomplete").addHelpText(
|
|
6304
6304
|
"after",
|
|
6305
6305
|
examples(
|
|
6306
|
-
"airs redteam
|
|
6307
|
-
"airs redteam
|
|
6308
|
-
"airs redteam
|
|
6309
|
-
"airs redteam
|
|
6306
|
+
"airs redteam report --output-file ./airs-daily.html",
|
|
6307
|
+
"airs redteam report --output markdown --output-file ./airs-daily.md",
|
|
6308
|
+
"airs redteam report",
|
|
6309
|
+
"airs redteam report --strict --max-pages 20 --output-file - > daily.html"
|
|
6310
6310
|
)
|
|
6311
|
-
).action(async (opts) => {
|
|
6311
|
+
).action(async (jobId, opts) => {
|
|
6312
|
+
const explicit = (name) => command.getOptionValueSource(name) === "cli";
|
|
6313
|
+
if (jobId !== void 0) {
|
|
6314
|
+
if (["output", "outputFile", "title", "maxPages", "strict"].some(explicit) || ["html", "markdown"].includes(command.parent?.parent?.opts().output))
|
|
6315
|
+
usageError("Environment report options cannot be combined with a scan job ID");
|
|
6316
|
+
await scanReport(jobId, opts);
|
|
6317
|
+
return;
|
|
6318
|
+
}
|
|
6319
|
+
if (["attacks", "severity", "limit"].some(explicit))
|
|
6320
|
+
usageError("--attacks, --severity and --limit require a scan job ID");
|
|
6312
6321
|
const format = opts.output ?? command.parent?.parent?.opts().output ?? "html";
|
|
6313
6322
|
if (format !== "html" && format !== "markdown")
|
|
6314
6323
|
usageError("Report output must be html or markdown");
|
|
@@ -6603,7 +6612,6 @@ function parseAdapterVariables(input) {
|
|
|
6603
6612
|
}
|
|
6604
6613
|
function registerRedteamCommand(program) {
|
|
6605
6614
|
const redteam = program.command("redteam").description("AI Red Team scan operations");
|
|
6606
|
-
registerRedTeamDashboardCommand(redteam);
|
|
6607
6615
|
redteam.command("abort <jobId>").description("Abort a running scan").action(async (jobId) => {
|
|
6608
6616
|
try {
|
|
6609
6617
|
renderRedteamHeader();
|
|
@@ -6986,7 +6994,7 @@ function registerRedteamCommand(program) {
|
|
|
6986
6994
|
fail(err);
|
|
6987
6995
|
}
|
|
6988
6996
|
});
|
|
6989
|
-
redteam
|
|
6997
|
+
registerRedTeamReportCommand(redteam, async (jobId, opts) => {
|
|
6990
6998
|
try {
|
|
6991
6999
|
renderRedteamHeader();
|
|
6992
7000
|
const service = await createService3();
|
|
@@ -9421,7 +9429,7 @@ import { lstat as lstat4 } from "fs/promises";
|
|
|
9421
9429
|
import { resolve as resolve5 } from "path";
|
|
9422
9430
|
import { randomUUID as randomUUID6 } from "crypto";
|
|
9423
9431
|
function registerRuntimeReportCommand(runtime) {
|
|
9424
|
-
const command = runtime.command("report").description("Generate a daily AI Runtime Security environment
|
|
9432
|
+
const command = runtime.command("report").description("Generate a daily AI Runtime Security environment report (read-only)").option("--output <format>", "Deliverable format: html or markdown (default: html)").option(
|
|
9425
9433
|
"--output-file <path>",
|
|
9426
9434
|
"Destination (default: new timestamped file in CWD); - for stdout; never overwrite"
|
|
9427
9435
|
).option("--title <text>", "Report title", "Daily environment report").option("--max-pages <n>", "Page budget per source, 1\u2013100 (25 sessions/page)", "40").option("--strict", "Exit 1 after writing if any source is incomplete").addHelpText(
|
|
@@ -10779,12 +10787,12 @@ function buildProgram() {
|
|
|
10779
10787
|
program.hook("preAction", async (_thisCommand, actionCommand) => {
|
|
10780
10788
|
const root = actionCommand.optsWithGlobals?.() ?? _thisCommand.opts();
|
|
10781
10789
|
setQuiet(Boolean(root.quiet));
|
|
10782
|
-
const isEnvironmentReport = actionCommand.name() === "report" && actionCommand.parent?.name()
|
|
10790
|
+
const isEnvironmentReport = actionCommand.name() === "report" && ["runtime", "redteam", "aigateway"].includes(actionCommand.parent?.name() ?? "") && !(actionCommand.parent?.name() === "redteam" && actionCommand.args.length > 0);
|
|
10783
10791
|
if (isEnvironmentReport && (root.debug || /^(1|true|yes|on)$/i.test(process.env.PANW_AI_SEC_DEBUG?.trim() ?? "")))
|
|
10784
10792
|
usageError(
|
|
10785
10793
|
"Disable --debug and PANW_AI_SEC_DEBUG for environment reports to avoid persisting sensitive traffic content"
|
|
10786
10794
|
);
|
|
10787
|
-
if (!isEnvironmentReport && READ_COMMAND_NAMES.has(actionCommand.name()) && actionCommand.options.some((option) => option.long === "--output")) {
|
|
10795
|
+
if (!isEnvironmentReport && !(actionCommand.name() === "report" && actionCommand.parent?.name() === "redteam") && READ_COMMAND_NAMES.has(actionCommand.name()) && actionCommand.options.some((option) => option.long === "--output")) {
|
|
10788
10796
|
try {
|
|
10789
10797
|
const format = await resolveOutput(actionCommand, actionCommand.opts());
|
|
10790
10798
|
actionCommand.setOptionValueWithSource("output", format, "implied");
|
package/dist/index.d.ts
CHANGED
|
@@ -2005,7 +2005,7 @@ interface GatewayReportOptions {
|
|
|
2005
2005
|
/** Collect all 25 supplied read feeds; retain only allowlisted aggregate evidence. */
|
|
2006
2006
|
declare function collectGatewayEnvironmentReport(client: GatewayReportClient, options: GatewayReportOptions): Promise<EnvironmentReport>;
|
|
2007
2007
|
|
|
2008
|
-
/** Portable Markdown using the same allowlisted evidence as the HTML
|
|
2008
|
+
/** Portable Markdown using the same allowlisted evidence as the HTML report. */
|
|
2009
2009
|
declare function renderEnvironmentReportMarkdown(r: EnvironmentReport): string;
|
|
2010
2010
|
/** Self-contained HTML with hash-based CSP, static inline JS/CSS and no remote resources. */
|
|
2011
2011
|
declare function renderEnvironmentReportHtml(r: EnvironmentReport): string;
|
|
@@ -2047,7 +2047,7 @@ interface RedTeamEnvironmentReport {
|
|
|
2047
2047
|
/** Collect seven read-only feeds, with explicit source budgets and independent metric windows. */
|
|
2048
2048
|
declare function collectRedTeamEnvironmentReport(client: RedTeamReportClient, options?: RuntimeReportOptions): Promise<RedTeamEnvironmentReport>;
|
|
2049
2049
|
|
|
2050
|
-
/** Portable Markdown using the same allowlisted evidence as the HTML
|
|
2050
|
+
/** Portable Markdown using the same allowlisted evidence as the HTML report. */
|
|
2051
2051
|
declare function renderRedTeamReportMarkdown(report: RedTeamEnvironmentReport): string;
|
|
2052
2052
|
/** Self-contained HTML with hash-based CSP and no remote resources. */
|
|
2053
2053
|
declare function renderRedTeamReportHtml(report: RedTeamEnvironmentReport): string;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cdot65/prisma-airs-cli",
|
|
3
3
|
"packageManager": "pnpm@10.6.5",
|
|
4
|
-
"version": "5.
|
|
4
|
+
"version": "5.3.0",
|
|
5
5
|
"description": "CLI and library for Palo Alto Prisma AIRS — guardrail refinement, AI red teaming, model security scanning, profile audits",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "dist/index.js",
|