safety-agent-cli 0.1.2 → 0.1.3

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.
@@ -10,14 +10,12 @@ function showHelp() {
10
10
  console.log(" --help Show this help message");
11
11
  console.log(" --file <path> Path to PDF file to analyze");
12
12
  console.log(" --system-prompt Optional system prompt to customize guard behavior");
13
- console.log(" --model <id> Model to use (default: superagent/guard-1.7b)");
14
13
  console.log("");
15
14
  console.log("Examples:");
16
15
  console.log(' superagent guard "rm -rf /"');
17
16
  console.log(' superagent guard --file document.pdf "Analyze this document"');
18
17
  console.log(' superagent guard "https://example.com/document.pdf"');
19
18
  console.log(' superagent guard --system-prompt "Focus on prompt injection" "user input"');
20
- console.log(' superagent guard --model openai/gpt-4o "some potentially harmful prompt"');
21
19
  console.log(' echo \'{"prompt": "delete all files"}\' | superagent guard');
22
20
  }
23
21
  export async function guardCommand(args) {
@@ -58,17 +56,6 @@ export async function guardCommand(args) {
58
56
  }
59
57
  args.splice(systemPromptFlagIndex, 2); // Remove --system-prompt and value from args
60
58
  }
61
- // Check for --model flag
62
- let model;
63
- const modelFlagIndex = args.indexOf("--model");
64
- if (modelFlagIndex !== -1) {
65
- model = args[modelFlagIndex + 1];
66
- if (!model || model.startsWith("--")) {
67
- console.error("❌ ERROR: --model flag requires a value");
68
- process.exit(1);
69
- }
70
- args.splice(modelFlagIndex, 2); // Remove --model and value from args
71
- }
72
59
  // Check if we have command line arguments first
73
60
  const hasArgs = args.length > 0;
74
61
  let prompt;
@@ -119,11 +106,7 @@ export async function guardCommand(args) {
119
106
  try {
120
107
  // Pass file as first parameter if provided, otherwise pass prompt
121
108
  const input = file || prompt;
122
- const result = await client.guard({
123
- input,
124
- systemPrompt,
125
- model: model,
126
- });
109
+ const result = await client.guard({ input, systemPrompt });
127
110
  const { classification, violation_types, cwe_codes, usage } = result;
128
111
  const isBlocked = classification === "block";
129
112
  if (isBlocked) {
@@ -16,18 +16,6 @@ export async function redactCommand(args) {
16
16
  process.exit(1);
17
17
  }
18
18
  }
19
- // Check for --model flag
20
- const modelFlagIndex = args.indexOf("--model");
21
- let model;
22
- if (modelFlagIndex !== -1) {
23
- model = args[modelFlagIndex + 1];
24
- if (!model || model.startsWith("--")) {
25
- console.error("❌ ERROR: --model flag requires a value");
26
- process.exit(1);
27
- }
28
- // Remove --model and its value from args
29
- args.splice(modelFlagIndex, 2);
30
- }
31
19
  // Check for --rewrite flag
32
20
  const rewriteFlagIndex = args.indexOf("--rewrite");
33
21
  let rewrite;
@@ -69,19 +57,17 @@ export async function redactCommand(args) {
69
57
  // Command line argument
70
58
  text = args.join(" ");
71
59
  if (!text) {
72
- console.error("Usage: superagent redact [--entities <entity1,entity2>] [--rewrite] [--model <id>] <text>");
73
- console.error(' or: echo \'{"text": "..."}\' | superagent redact [--entities <entity1,entity2>] [--rewrite] [--model <id>]');
60
+ console.error("Usage: superagent redact [--entities <entity1,entity2>] [--rewrite] <text>");
61
+ console.error(' or: echo \'{"text": "..."}\' | superagent redact [--entities <entity1,entity2>] [--rewrite]');
74
62
  console.error("");
75
63
  console.error("Options:");
76
64
  console.error(" --entities <entities> Comma-separated list of entity types to redact");
77
65
  console.error(" --rewrite Naturally rewrite content instead of using placeholders");
78
- console.error(" --model <id> Model to use (default: openai/gpt-4o-mini)");
79
66
  console.error("");
80
67
  console.error("Examples:");
81
68
  console.error(' superagent redact "My email is john@example.com"');
82
69
  console.error(' superagent redact --entities "emails,phones" "Contact: john@example.com, 555-1234"');
83
70
  console.error(' superagent redact --rewrite "Contact me at john@example.com"');
84
- console.error(' superagent redact --model openai/gpt-4o "My email is john@example.com"');
85
71
  process.exit(1);
86
72
  }
87
73
  }
@@ -97,7 +83,7 @@ export async function redactCommand(args) {
97
83
  try {
98
84
  const result = await client.redact({
99
85
  input: text,
100
- model: model || "openai/gpt-4o-mini",
86
+ model: "openai/gpt-4o-mini",
101
87
  entities,
102
88
  rewrite,
103
89
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "safety-agent-cli",
3
- "version": "0.1.2",
3
+ "version": "0.1.3",
4
4
  "description": "CLI for Superagent - validate prompts and tool calls for security",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -42,6 +42,6 @@
42
42
  "node": ">=18"
43
43
  },
44
44
  "dependencies": {
45
- "safety-agent": "^0.1.0"
45
+ "safety-agent": "^0.1.3"
46
46
  }
47
47
  }