shellward 0.5.7 → 0.5.8
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/package.json +1 -1
- package/src/core/engine.ts +16 -0
- package/src/index.ts +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "shellward",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.8",
|
|
4
4
|
"description": "AI Agent Security Middleware — 8-layer defense against prompt injection, data exfiltration & dangerous commands. DLP model: use data freely, block external leaks. Zero dependencies. SDK + OpenClaw plugin. Supports LangChain, AutoGPT, Claude Code, Cursor, OpenAI Agents.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"shellward",
|
package/src/core/engine.ts
CHANGED
|
@@ -377,6 +377,22 @@ export class ShellWard {
|
|
|
377
377
|
return { allowed: false, level: 'CRITICAL', reason, ruleId: 'no_payment' }
|
|
378
378
|
}
|
|
379
379
|
|
|
380
|
+
// Block outbound actions when sensitive data was recently accessed (DLP via Gate)
|
|
381
|
+
const outboundActions = ['send_email', 'send_message', 'post_tweet', 'http_post', 'curl_post']
|
|
382
|
+
if (outboundActions.includes(action) && this.hasSensitiveData) {
|
|
383
|
+
const reason = this.locale === 'zh'
|
|
384
|
+
? `数据外泄拦截: 近期访问了敏感数据,禁止通过 ${action} 向外部发送`
|
|
385
|
+
: `Data exfiltration blocked: sensitive data recently accessed, ${action} denied`
|
|
386
|
+
this.log.write({
|
|
387
|
+
level: 'CRITICAL',
|
|
388
|
+
layer: 'L5',
|
|
389
|
+
action: 'block',
|
|
390
|
+
detail: `Gate denied (DLP): ${action}`,
|
|
391
|
+
pattern: 'gate_data_exfil',
|
|
392
|
+
})
|
|
393
|
+
return { allowed: false, level: 'CRITICAL', reason, ruleId: 'gate_data_exfil' }
|
|
394
|
+
}
|
|
395
|
+
|
|
380
396
|
this.log.write({
|
|
381
397
|
level: 'INFO',
|
|
382
398
|
layer: 'L5',
|
package/src/index.ts
CHANGED
|
@@ -20,7 +20,7 @@ import { registerAllCommands } from './commands/index'
|
|
|
20
20
|
import { checkForUpdate } from './update-check'
|
|
21
21
|
import { runAutoCheckOnStartup } from './auto-check'
|
|
22
22
|
|
|
23
|
-
const CURRENT_VERSION = '0.5.
|
|
23
|
+
const CURRENT_VERSION = '0.5.8'
|
|
24
24
|
|
|
25
25
|
// Re-export core engine for SDK usage
|
|
26
26
|
export { ShellWard } from './core/engine'
|