censiq 0.1.3 → 0.1.5
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 +65 -10
- package/package.json +1 -1
- package/src/commands/run.js +6 -2
- package/templates/arena.yaml +7 -2
package/README.md
CHANGED
|
@@ -100,7 +100,7 @@ The wizard prompts for:
|
|
|
100
100
|
- Agent name and purpose
|
|
101
101
|
- Risk level (low / medium / high / critical)
|
|
102
102
|
- Allowed actions your agent can take
|
|
103
|
-
- Connection type:
|
|
103
|
+
- Connection type: OpenAI, Anthropic, custom API endpoint, or prompt simulation
|
|
104
104
|
- Test suite and intensity
|
|
105
105
|
- Number of repeats for consistency scoring
|
|
106
106
|
|
|
@@ -148,12 +148,22 @@ allowed_actions:
|
|
|
148
148
|
|
|
149
149
|
# Agent connection — choose one mode
|
|
150
150
|
agent:
|
|
151
|
-
# Mode 1:
|
|
152
|
-
type:
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
# Mode 2:
|
|
151
|
+
# Mode 1: OpenAI model
|
|
152
|
+
type: openai
|
|
153
|
+
key: "${OPENAI_API_KEY}"
|
|
154
|
+
model: gpt-4o # gpt-4o | gpt-4-turbo | gpt-3.5-turbo | o1-mini
|
|
155
|
+
|
|
156
|
+
# Mode 2: Anthropic / Claude model
|
|
157
|
+
# type: anthropic
|
|
158
|
+
# key: "${ANTHROPIC_API_KEY}"
|
|
159
|
+
# model: claude-opus-4-7 # claude-opus-4-7 | claude-sonnet-4-6 | claude-haiku-4-5-20251001
|
|
160
|
+
|
|
161
|
+
# Mode 3: any custom API endpoint
|
|
162
|
+
# type: api
|
|
163
|
+
# endpoint: "https://your-agent.example.com/chat"
|
|
164
|
+
# key: "${AGENT_API_KEY}"
|
|
165
|
+
|
|
166
|
+
# Mode 4: prompt simulation (no live endpoint — tests a system prompt)
|
|
157
167
|
# type: prompt
|
|
158
168
|
# system_prompt: "You are a security analyst..."
|
|
159
169
|
|
|
@@ -175,7 +185,35 @@ output:
|
|
|
175
185
|
|
|
176
186
|
### Agent connection modes
|
|
177
187
|
|
|
178
|
-
|
|
188
|
+
**`openai`** — calls OpenAI's chat completions API directly. Provide your OpenAI API key and model; no endpoint configuration needed.
|
|
189
|
+
|
|
190
|
+
```yaml
|
|
191
|
+
agent:
|
|
192
|
+
type: openai
|
|
193
|
+
key: "${OPENAI_API_KEY}"
|
|
194
|
+
model: gpt-4o
|
|
195
|
+
system_prompt: "You are a security AI assistant." # optional
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
Supported models: `gpt-4o`, `gpt-4-turbo`, `gpt-3.5-turbo`, `o1-mini`, and any current OpenAI chat model.
|
|
199
|
+
|
|
200
|
+
---
|
|
201
|
+
|
|
202
|
+
**`anthropic`** — calls the Anthropic API directly using your own API key.
|
|
203
|
+
|
|
204
|
+
```yaml
|
|
205
|
+
agent:
|
|
206
|
+
type: anthropic
|
|
207
|
+
key: "${ANTHROPIC_API_KEY}"
|
|
208
|
+
model: claude-opus-4-7
|
|
209
|
+
system_prompt: "You are a security AI assistant." # optional
|
|
210
|
+
```
|
|
211
|
+
|
|
212
|
+
Supported models: `claude-opus-4-7`, `claude-sonnet-4-6`, `claude-haiku-4-5-20251001`.
|
|
213
|
+
|
|
214
|
+
---
|
|
215
|
+
|
|
216
|
+
**`api`** — sends each scenario as a POST to your own endpoint. Use this for custom agents, LangChain servers, or any AI backend you host yourself.
|
|
179
217
|
|
|
180
218
|
```
|
|
181
219
|
POST https://your-agent.example.com/chat
|
|
@@ -184,9 +222,26 @@ Content-Type: application/json
|
|
|
184
222
|
{ "message": "<scenario prompt>", "prompt": "<scenario prompt>" }
|
|
185
223
|
```
|
|
186
224
|
|
|
187
|
-
Your endpoint must return
|
|
225
|
+
Your endpoint must return JSON with one of these fields: `response`, `message`, `content`, `text`, or `choices[0].message.content`.
|
|
188
226
|
|
|
189
|
-
|
|
227
|
+
```yaml
|
|
228
|
+
agent:
|
|
229
|
+
type: api
|
|
230
|
+
endpoint: "https://your-agent.example.com/chat"
|
|
231
|
+
key: "${AGENT_API_KEY}"
|
|
232
|
+
headers: # optional custom headers
|
|
233
|
+
x-tenant-id: "acme"
|
|
234
|
+
```
|
|
235
|
+
|
|
236
|
+
---
|
|
237
|
+
|
|
238
|
+
**`prompt`** — simulates your agent using a system prompt, powered by Censiq's built-in model. Useful for testing a prompt before wiring up a live endpoint.
|
|
239
|
+
|
|
240
|
+
```yaml
|
|
241
|
+
agent:
|
|
242
|
+
type: prompt
|
|
243
|
+
system_prompt: "You are a security analyst..."
|
|
244
|
+
```
|
|
190
245
|
|
|
191
246
|
### Environment variable expansion
|
|
192
247
|
|
package/package.json
CHANGED
package/src/commands/run.js
CHANGED
|
@@ -59,9 +59,13 @@ async function run(opts) {
|
|
|
59
59
|
apiKey: agentCfg.key || '',
|
|
60
60
|
apiHeaders: agentCfg.headers || {},
|
|
61
61
|
} : agentCfg.type === 'openai' ? {
|
|
62
|
-
apiKey:
|
|
63
|
-
openaiModel:
|
|
62
|
+
apiKey: agentCfg.key || '',
|
|
63
|
+
openaiModel: agentCfg.model || 'gpt-4o',
|
|
64
64
|
systemPrompt: agentCfg.system_prompt || '',
|
|
65
|
+
} : agentCfg.type === 'anthropic' ? {
|
|
66
|
+
apiKey: agentCfg.key || '',
|
|
67
|
+
anthropicModel: agentCfg.model || 'claude-opus-4-7',
|
|
68
|
+
systemPrompt: agentCfg.system_prompt || '',
|
|
65
69
|
} : {
|
|
66
70
|
systemPrompt: agentCfg.system_prompt || '',
|
|
67
71
|
}),
|
package/templates/arena.yaml
CHANGED
|
@@ -12,12 +12,17 @@ allowed_actions:
|
|
|
12
12
|
- flag_as_ioc
|
|
13
13
|
|
|
14
14
|
agent:
|
|
15
|
-
type: openai # openai | api | prompt
|
|
15
|
+
type: openai # openai | anthropic | api | prompt
|
|
16
16
|
key: "${OPENAI_API_KEY}" # reads from environment variable
|
|
17
17
|
model: gpt-4o # gpt-4o | gpt-4-turbo | gpt-3.5-turbo | o1-mini
|
|
18
18
|
system_prompt: "You are a security AI assistant."
|
|
19
19
|
|
|
20
|
-
# --- OR for
|
|
20
|
+
# --- OR for Anthropic / Claude ---
|
|
21
|
+
# type: anthropic
|
|
22
|
+
# key: "${ANTHROPIC_API_KEY}"
|
|
23
|
+
# model: claude-opus-4-7 # claude-opus-4-7 | claude-sonnet-4-6 | claude-haiku-4-5-20251001
|
|
24
|
+
|
|
25
|
+
# --- OR for any other AI API endpoint ---
|
|
21
26
|
# type: api
|
|
22
27
|
# endpoint: "https://my-agent.example.com/chat"
|
|
23
28
|
# key: "${AGENT_API_KEY}"
|