nexus-agents - v2.80.0
    Preparing search index...

    Class PolicyFirewall

    Policy firewall that evaluates rules to authorize or deny operations.

    Rules are evaluated in order. The first rule that denies the operation stops evaluation and returns the denial. If all rules pass, the operation is allowed.

    const firewall = new PolicyFirewall({ mode: 'enforce' });

    // Add rules
    firewall.addRule(denyMutationsWithoutModeRule);
    firewall.addRule(safePathsRule);

    // Evaluate
    const decision = firewall.evaluate({
    toolName: 'write_file',
    args: { path: '/etc/passwd' },
    mode: 'read-only',
    });

    if (!decision.allowed) {
    console.error(`Denied: ${decision.reason}`);
    }

    Implements

    Index

    Constructors

    Methods