add security hardening features (#543)
* add security hardening features - Add authentication vault (`auth save/login/list/show/delete`) so credentials are stored locally and never exposed to the LLM (fixes Snyk W007) - Add `--content-boundaries` flag to wrap page-sourced output in structural markers, helping LLMs distinguish tool output from untrusted page content (fixes Snyk W011) - Add `--allowed-domains` flag to restrict browser navigation to trusted domains - Add `--action-policy` for static allow/deny gating of action categories, with opt-in `--confirm-actions`/`--confirm-interactive` for orchestrator or human-in-the-loop confirmation - Add `--max-output` flag to truncate large page outputs, preventing context flooding - New docs page at /security, updated README, SKILL.md, CLI help text, and templates * fixes * fixes * fixes * fixes * fixes * fixes * fixes * docs
This commit is contained in:
+76
-1
@@ -33,6 +33,9 @@ export interface LaunchCommand extends BaseCommand {
|
||||
allowFileAccess?: boolean; // Enable file:// URL access and cross-origin file requests
|
||||
colorScheme?: 'light' | 'dark' | 'no-preference'; // Persistent color scheme override
|
||||
downloadPath?: string; // Directory for browser downloads (Playwright's downloadsPath)
|
||||
allowedDomains?: string[];
|
||||
actionPolicy?: string;
|
||||
confirmActions?: string[];
|
||||
// Auto-load state file for session persistence
|
||||
autoStateFilePath?: string;
|
||||
}
|
||||
@@ -1022,7 +1025,54 @@ export type Command =
|
||||
| DeviceListCommand
|
||||
| DiffSnapshotCommand
|
||||
| DiffScreenshotCommand
|
||||
| DiffUrlCommand;
|
||||
| DiffUrlCommand
|
||||
| AuthSaveCommand
|
||||
| AuthLoginCommand
|
||||
| AuthListCommand
|
||||
| AuthDeleteCommand
|
||||
| AuthShowCommand
|
||||
| ConfirmCommand
|
||||
| DenyCommand;
|
||||
|
||||
export interface AuthSaveCommand extends BaseCommand {
|
||||
action: 'auth_save';
|
||||
name: string;
|
||||
url: string;
|
||||
username: string;
|
||||
password: string;
|
||||
usernameSelector?: string;
|
||||
passwordSelector?: string;
|
||||
submitSelector?: string;
|
||||
}
|
||||
|
||||
export interface AuthLoginCommand extends BaseCommand {
|
||||
action: 'auth_login';
|
||||
name: string;
|
||||
}
|
||||
|
||||
export interface AuthListCommand extends BaseCommand {
|
||||
action: 'auth_list';
|
||||
}
|
||||
|
||||
export interface AuthDeleteCommand extends BaseCommand {
|
||||
action: 'auth_delete';
|
||||
name: string;
|
||||
}
|
||||
|
||||
export interface AuthShowCommand extends BaseCommand {
|
||||
action: 'auth_show';
|
||||
name: string;
|
||||
}
|
||||
|
||||
export interface ConfirmCommand extends BaseCommand {
|
||||
action: 'confirm';
|
||||
confirmationId: string;
|
||||
}
|
||||
|
||||
export interface DenyCommand extends BaseCommand {
|
||||
action: 'deny';
|
||||
confirmationId: string;
|
||||
}
|
||||
|
||||
// Diff commands
|
||||
export interface DiffSnapshotCommand extends BaseCommand {
|
||||
@@ -1091,14 +1141,39 @@ export interface ScreenshotData {
|
||||
|
||||
export interface SnapshotData {
|
||||
snapshot: string;
|
||||
refs?: Record<string, { role: string; name?: string }>;
|
||||
origin?: string;
|
||||
}
|
||||
|
||||
export interface EvaluateData {
|
||||
result: unknown;
|
||||
origin?: string;
|
||||
}
|
||||
|
||||
export interface ContentData {
|
||||
html: string;
|
||||
origin?: string;
|
||||
}
|
||||
|
||||
export interface TextData {
|
||||
text: string | null;
|
||||
origin?: string;
|
||||
}
|
||||
|
||||
export interface AttributeData {
|
||||
attribute: string;
|
||||
value: string | null;
|
||||
origin?: string;
|
||||
}
|
||||
|
||||
export interface ValueData {
|
||||
value: string;
|
||||
origin?: string;
|
||||
}
|
||||
|
||||
export interface ConsoleData {
|
||||
messages: Array<{ type: string; text: string }>;
|
||||
origin?: string;
|
||||
}
|
||||
|
||||
export interface TabInfo {
|
||||
|
||||
Reference in New Issue
Block a user