Skip to content

Test file permissions and content inspection ​

中文 · Install FinShield

These examples check file operations and model requests. File permissions determine which files a process can read or delete; Inspector applies content policy to sensitive text waiting to be sent. Complete installation and host setup, then choose your platform.

macOS and Linux: compare file access ​

Extract the matching CLI release and keep its accompanying programs. Follow the platform installation and host setup first; on Linux, use ./finsafe doctor from the extracted directory to check the required host capabilities. A setup error is different from a denied file operation.

Open the local comparison page from the extracted directory:

sh
./finsafe --visual

If the browser does not open, open the local address printed in the terminal. No Agent, model account, API key or policy YAML is needed.

  1. Select File vault and keep its initial file rules.
  2. Select Project brief and Run comparison. The sample project file is readable with the sandbox off and on.
  3. Select Salary data and Run comparison. The synthetic salary file is readable with the sandbox off; the file rule blocks access with it on.

The page shows the actual commands, output and results for both runs. It creates synthetic fixtures in the local temporary demo directory. This demonstrates file-access rules; the salary sample is blocked by its path rule, not by a PII content detector. The Windows finsafe demo inspector walkthrough below is a separate entry.

Press Ctrl+C in the terminal to stop the comparison server. If a protected run cannot start, resolve the reported host/setup issue before interpreting the result as a successful block. The public v0.11.85 macOS and Linux archives reuse v0.11.48 CLI artifacts; their archive label does not imply they include Windows's newer Inspector demo.

Before you start on Windows ​

Use PowerShell with FinShield installed. The file example uses the default Windows permissions, so finish the installer's permission preparation first. The Inspector demo needs a Windows build with finsafe demo inspector, introduced in v0.11.85. Check your executable:

powershell
finsafe version
finsafe help

If finsafe is not on PATH, the standard standalone installation uses & "$env:ProgramFiles\FinSAFE\finsafe.exe" in its place. If the demo command is missing, use a Windows build that includes it; see the release notes and downloads. The following two examples are for Windows.

File permissions: test deletion in a read-only directory ​

Create a test file in the temporary directory, then execute its deletion in the sandbox. The default configuration permits writes to this directory:

powershell
Set-Content "$env:TEMP\finsafe-demo-cache.txt" cache
finsafe run -- cmd /c del "$env:TEMP\finsafe-demo-cache.txt"
# Deletion succeeds.

Now put a test file in FinShield's own data directory, which the default policy makes read-only to sandboxed processes:

powershell
Set-Content "$env:LOCALAPPDATA\FinSAFE\finsafe-demo-keep.txt" keep
finsafe run -- cmd /c del "$env:LOCALAPPDATA\FinSAFE\finsafe-demo-keep.txt"
# Access is denied. The test file remains.

PowerShell outside the sandbox creates the test files; finsafe run executes their deletion inside it. Both files were created by the same user, but their directory permissions inside the sandbox produce different results. Only the named test files are used. No extra YAML or new directory authorization is needed.

When finished, remove the protected test file from the ordinary PowerShell session:

powershell
Remove-Item "$env:LOCALAPPDATA\FinSAFE\finsafe-demo-keep.txt"

This illustrates the default directory boundary. Other writable directories can still be changed or deleted; see plugin defaults.

Content inspection: block sensitive text before it reaches a model ​

Start the local Inspector + PII demo and check whether the request actually reaches the receiver:

powershell
finsafe demo inspector

The command opens a browser and prints its local address in the terminal. If the browser does not open, open that address manually. Keep the terminal running.

No Agent, model account, API key or YAML is needed. The demo uses the existing Inspector content path and built-in detector, with a local mock model as the receiver. It does not request UAC, install a certificate or change your installed protection settings.

Send two messages ​

  1. Keep Block selected and send the Ordinary message preset, Hello, FinShield.. The message is inspected and the local receiver gets it.
  2. Select the Resident ID preset and send it. The synthetic sample contains 11010519491231002X. Inspector reports cn.resident_id, blocks the request, and the local receiver gets no request.

The page shows the prepared content, actual inspection result and local delivery result. Expand the request details to compare the generated Chat Completions JSON with the request actually received. You do not need to construct a conversation yourself.

Try Warn and Ask ​

Send the same resident-ID preset with each handling mode:

ModeWhat you see
WarnA sensitive-information finding; the original request reaches the local receiver.
AskThe existing Windows send-confirmation window. Allow once sends the held request; cancel, closing the window or timeout does not send it.
BlockThe sensitive request is stopped; the local receiver gets no request.

Switch the page between English and Simplified Chinese without resending. The native confirmation window follows the product's existing language preference.

Press Ctrl+C in the terminal to stop the demo.

What this example shows ​

The demo uses real request-content inspection and actual receiver observations. It demonstrates detection, warning, approval and blocking. It does not demonstrate redaction, HTTPS decryption or interception of a real Agent's traffic. The demo's selected mode does not enable PII in other applications.

Continue with network access and PII or how Inspector processes requests. DSH and OpenCode plugin defaults use host networking; real-Agent inspection requires a supported inspection path and configuration.