mirror of
https://github.com/JackChen-me/open-multi-agent.git
synced 2026-10-22 02:53:26 -05:00
Ships an opt-in, dependency-free shell risk classifier for the onToolCall gate (#377). classifyBashCommand(command) returns safe | review | high so users get the taxonomy from #96 without writing regex tables by hand. - safe: read-only inspection (ls, cat, grep/rg with a path, git status/log/diff) - review: context bombs and unknowns (ls -R, find / without -maxdepth, grep -r / rg -r without scope, tree, du, unrecognised commands) - high: destructive/sensitive (rm, sudo, curl | bash, dd, mkfs, chmod 777/-R, git push --force, npm publish) Compound commands are segmented on shell separators and the highest risk wins; quoted strings are stripped so patterns inside a string do not match. Convenience heuristic, not a security boundary. Exported only via @open-multi-agent/core/classifiers so pattern tables never load unless imported. Closes #379
8 lines
410 B
TypeScript
8 lines
410 B
TypeScript
/**
|
|
* Optional risk classifiers, shipped behind the `@open-multi-agent/core/classifiers`
|
|
* subpath so their pattern tables never load unless imported. Convenience
|
|
* helpers for `onToolCallGate` policies — not part of the core import surface.
|
|
*/
|
|
export type { BashRiskLevel, BashRiskAssessment } from './tool/classifiers/bash-risk.js'
|
|
export { classifyBashCommand } from './tool/classifiers/bash-risk.js'
|