Scanning in IDEs
After you connect your IDE to the Lineaje MCP server and enable policies, you can scan for policy violations on demand, or automatically with a hook.
Policies are disabled by default. Until you enable policies in UnifAI, a scan has no policies to evaluate against.
On-demand scanning
Use this workflow when hook functionality is disabled in your environment or unavailable in your IDE.
You can request manuals scans for policy violations:
To check for violations, open, edit, and save the file you want to be scanned. You can do this in an IDE (for example, Cursor) or CLI (for example Claude Code).
Run the command
scan file_processor.py using Lineaje. Replacefile_processor.pywith your file name. Lineaje performs a policy‑violation scan on the specified file and generates a detailed report. The report includes the project evaluated, the policies applied, and the controls enforced during the scan.
On-demand scans use the security_workflow tool. It proposes code changes but doesn't edit your files.
If the Lineaje MCP server is not detected during scanning, disable the MCP server, then enable it. In addition, select the latest agent model instead of an auto Agent.
The following examples display Lineaje suggestions for modifying code to prevent policy violations.
Cursor

Claude Code

Installing a hook for automatic scanning
Use this workflow when hook integration is available in your IDE.
Hooks automatically detect changes to a file and send the file to the MCP server for policy violation detection and remediation.
Before you configure a hook, you need the unifAI-hooks folder on your machine. In the snippet below, replace /path/to/unifAI-hooks with the folder's location.
NEEDS INPUT: where users download unifAI-hooks, and the Python version it requires.
Cursor
To install a hook in Cursor:
Open a file in your repository.
Go to Settings > Hooks.
Click Open user config.
Copy and paste the following JSON configuration snippet:
{
"version": 1,
"hooks": {
"afterFileEdit": [
{
"command": "python3 /path/to/unifAI-hooks/hooks/after_file_edit_hook_handler.py"
}
],
"stop": [
{
"command": "python3 /path/to/unifAI-hooks/hooks/stop_hook_handler.py"
}
]
}
}
Open the file that you want Lineaje to scan.
As you write code, Lineaje evaluates the selected file for policy violations and produces a detailed report. The report lists the project reviewed, the applied policies, and the controls enforced.
Last updated