visus-mcp 0.6.2 → 0.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude/settings.local.json +6 -1
- package/.env.status +7 -0
- package/CHANGELOG.md +65 -0
- package/CLAUDE.md +3 -0
- package/README.md +15 -7
- package/SECURITY.md +2 -0
- package/STATUS.md +203 -9
- package/dist/content-handlers/index.d.ts +36 -0
- package/dist/content-handlers/index.d.ts.map +1 -0
- package/dist/content-handlers/index.js +59 -0
- package/dist/content-handlers/index.js.map +1 -0
- package/dist/content-handlers/json-handler.d.ts +28 -0
- package/dist/content-handlers/json-handler.d.ts.map +1 -0
- package/dist/content-handlers/json-handler.js +116 -0
- package/dist/content-handlers/json-handler.js.map +1 -0
- package/dist/content-handlers/pdf-handler.d.ts +29 -0
- package/dist/content-handlers/pdf-handler.d.ts.map +1 -0
- package/dist/content-handlers/pdf-handler.js +77 -0
- package/dist/content-handlers/pdf-handler.js.map +1 -0
- package/dist/content-handlers/svg-handler.d.ts +35 -0
- package/dist/content-handlers/svg-handler.d.ts.map +1 -0
- package/dist/content-handlers/svg-handler.js +206 -0
- package/dist/content-handlers/svg-handler.js.map +1 -0
- package/dist/content-handlers/types.d.ts +42 -0
- package/dist/content-handlers/types.d.ts.map +1 -0
- package/dist/content-handlers/types.js +7 -0
- package/dist/content-handlers/types.js.map +1 -0
- package/dist/tools/fetch.d.ts.map +1 -1
- package/dist/tools/fetch.js +62 -4
- package/dist/tools/fetch.js.map +1 -1
- package/package.json +2 -1
- package/server.json +2 -2
- package/src/content-handlers/index.ts +72 -0
- package/src/content-handlers/json-handler.ts +137 -0
- package/src/content-handlers/pdf-handler.ts +91 -0
- package/src/content-handlers/svg-handler.ts +243 -0
- package/src/content-handlers/types.ts +44 -0
- package/src/tools/fetch.ts +69 -4
- package/.github/ISSUE_TEMPLATE/bug_report.md +0 -47
- package/.github/ISSUE_TEMPLATE/false_positive.md +0 -43
- package/.github/ISSUE_TEMPLATE/new_pattern.md +0 -49
- package/.github/ISSUE_TEMPLATE/security_report.md +0 -31
- package/.github/PULL_REQUEST_TEMPLATE.md +0 -39
- package/.mcpregistry_github_token +0 -1
- package/.mcpregistry_registry_token +0 -1
- package/CONTRIBUTING.md +0 -329
- package/LINKEDIN-STRATEGY.md +0 -367
- package/ROADMAP.md +0 -221
- package/SECURITY-AUDIT-v1.md +0 -277
- package/SUBMISSION.md +0 -66
- package/TROUBLESHOOT-AUTH-20260322-2019.md +0 -291
- package/TROUBLESHOOT-BUILD-20260319-1450.md +0 -546
- package/TROUBLESHOOT-COGNITO-AUTH-20260324-2029.md +0 -415
- package/TROUBLESHOOT-COGNITO-JWT-20260324.md +0 -592
- package/TROUBLESHOOT-FETCH-20260320-1150.md +0 -168
- package/TROUBLESHOOT-JEST-20260323-1357.md +0 -139
- package/TROUBLESHOOT-LAMBDA-20260322-1945.md +0 -183
- package/TROUBLESHOOT-PLAYWRIGHT-20260321-1549.md +0 -217
- package/TROUBLESHOOT-SSL-20260320-1138.md +0 -171
- package/TROUBLESHOOT-STRUCTURED-20260320-1200.md +0 -246
- package/TROUBLESHOOT-TEST-20260320-0942.md +0 -281
- package/VISUS-CLAUDE-CODE-PROMPT.md +0 -324
- package/VISUS-PROJECT-PLAN.md +0 -205
- package/cdk.json +0 -73
- package/infrastructure/app.ts +0 -39
- package/infrastructure/stack.ts +0 -298
- package/jest.config.js +0 -33
- package/jest.setup.js +0 -9
- package/lambda-deploy/index.js +0 -81512
- package/lambda-deploy/index.js.map +0 -7
- package/lambda-package/browser/__mocks__/playwright-renderer.d.ts +0 -25
- package/lambda-package/browser/__mocks__/playwright-renderer.d.ts.map +0 -1
- package/lambda-package/browser/__mocks__/playwright-renderer.js +0 -119
- package/lambda-package/browser/__mocks__/playwright-renderer.js.map +0 -1
- package/lambda-package/browser/playwright-renderer.d.ts +0 -40
- package/lambda-package/browser/playwright-renderer.d.ts.map +0 -1
- package/lambda-package/browser/playwright-renderer.js +0 -214
- package/lambda-package/browser/playwright-renderer.js.map +0 -1
- package/lambda-package/browser/reader.d.ts +0 -31
- package/lambda-package/browser/reader.d.ts.map +0 -1
- package/lambda-package/browser/reader.js +0 -98
- package/lambda-package/browser/reader.js.map +0 -1
- package/lambda-package/index.d.ts +0 -18
- package/lambda-package/index.d.ts.map +0 -1
- package/lambda-package/index.js +0 -238
- package/lambda-package/index.js.map +0 -1
- package/lambda-package/lambda-handler.d.ts +0 -28
- package/lambda-package/lambda-handler.d.ts.map +0 -1
- package/lambda-package/lambda-handler.js +0 -257
- package/lambda-package/lambda-handler.js.map +0 -1
- package/lambda-package/package-lock.json +0 -7435
- package/lambda-package/package.json +0 -74
- package/lambda-package/runtime.d.ts +0 -50
- package/lambda-package/runtime.d.ts.map +0 -1
- package/lambda-package/runtime.js +0 -86
- package/lambda-package/runtime.js.map +0 -1
- package/lambda-package/sanitizer/elicit-runner.d.ts +0 -48
- package/lambda-package/sanitizer/elicit-runner.d.ts.map +0 -1
- package/lambda-package/sanitizer/elicit-runner.js +0 -100
- package/lambda-package/sanitizer/elicit-runner.js.map +0 -1
- package/lambda-package/sanitizer/framework-mapper.d.ts +0 -24
- package/lambda-package/sanitizer/framework-mapper.d.ts.map +0 -1
- package/lambda-package/sanitizer/framework-mapper.js +0 -342
- package/lambda-package/sanitizer/framework-mapper.js.map +0 -1
- package/lambda-package/sanitizer/hitl-gate.d.ts +0 -69
- package/lambda-package/sanitizer/hitl-gate.d.ts.map +0 -1
- package/lambda-package/sanitizer/hitl-gate.js +0 -101
- package/lambda-package/sanitizer/hitl-gate.js.map +0 -1
- package/lambda-package/sanitizer/index.d.ts +0 -63
- package/lambda-package/sanitizer/index.d.ts.map +0 -1
- package/lambda-package/sanitizer/index.js +0 -105
- package/lambda-package/sanitizer/index.js.map +0 -1
- package/lambda-package/sanitizer/injection-detector.d.ts +0 -34
- package/lambda-package/sanitizer/injection-detector.d.ts.map +0 -1
- package/lambda-package/sanitizer/injection-detector.js +0 -89
- package/lambda-package/sanitizer/injection-detector.js.map +0 -1
- package/lambda-package/sanitizer/patterns.d.ts +0 -30
- package/lambda-package/sanitizer/patterns.d.ts.map +0 -1
- package/lambda-package/sanitizer/patterns.js +0 -372
- package/lambda-package/sanitizer/patterns.js.map +0 -1
- package/lambda-package/sanitizer/pii-allowlist.d.ts +0 -49
- package/lambda-package/sanitizer/pii-allowlist.d.ts.map +0 -1
- package/lambda-package/sanitizer/pii-allowlist.js +0 -231
- package/lambda-package/sanitizer/pii-allowlist.js.map +0 -1
- package/lambda-package/sanitizer/pii-redactor.d.ts +0 -41
- package/lambda-package/sanitizer/pii-redactor.d.ts.map +0 -1
- package/lambda-package/sanitizer/pii-redactor.js +0 -213
- package/lambda-package/sanitizer/pii-redactor.js.map +0 -1
- package/lambda-package/sanitizer/severity-classifier.d.ts +0 -33
- package/lambda-package/sanitizer/severity-classifier.d.ts.map +0 -1
- package/lambda-package/sanitizer/severity-classifier.js +0 -113
- package/lambda-package/sanitizer/severity-classifier.js.map +0 -1
- package/lambda-package/sanitizer/threat-reporter.d.ts +0 -66
- package/lambda-package/sanitizer/threat-reporter.d.ts.map +0 -1
- package/lambda-package/sanitizer/threat-reporter.js +0 -163
- package/lambda-package/sanitizer/threat-reporter.js.map +0 -1
- package/lambda-package/tools/fetch-structured.d.ts +0 -51
- package/lambda-package/tools/fetch-structured.d.ts.map +0 -1
- package/lambda-package/tools/fetch-structured.js +0 -237
- package/lambda-package/tools/fetch-structured.js.map +0 -1
- package/lambda-package/tools/fetch.d.ts +0 -49
- package/lambda-package/tools/fetch.d.ts.map +0 -1
- package/lambda-package/tools/fetch.js +0 -131
- package/lambda-package/tools/fetch.js.map +0 -1
- package/lambda-package/tools/read.d.ts +0 -51
- package/lambda-package/tools/read.d.ts.map +0 -1
- package/lambda-package/tools/read.js +0 -127
- package/lambda-package/tools/read.js.map +0 -1
- package/lambda-package/tools/search.d.ts +0 -45
- package/lambda-package/tools/search.d.ts.map +0 -1
- package/lambda-package/tools/search.js +0 -220
- package/lambda-package/tools/search.js.map +0 -1
- package/lambda-package/types.d.ts +0 -167
- package/lambda-package/types.d.ts.map +0 -1
- package/lambda-package/types.js +0 -16
- package/lambda-package/types.js.map +0 -1
- package/lambda-package/utils/format-converter.d.ts +0 -39
- package/lambda-package/utils/format-converter.d.ts.map +0 -1
- package/lambda-package/utils/format-converter.js +0 -191
- package/lambda-package/utils/format-converter.js.map +0 -1
- package/lambda-package/utils/truncate.d.ts +0 -26
- package/lambda-package/utils/truncate.d.ts.map +0 -1
- package/lambda-package/utils/truncate.js +0 -54
- package/lambda-package/utils/truncate.js.map +0 -1
- package/lambda.zip +0 -0
- package/test-output.txt +0 -4
- package/tests/auth-smoke.test.ts +0 -480
- package/tests/elicit-runner.test.ts +0 -232
- package/tests/fetch-tool.test.ts +0 -922
- package/tests/hitl-gate.test.ts +0 -267
- package/tests/injection-corpus.ts +0 -338
- package/tests/pii-allowlist.test.ts +0 -282
- package/tests/reader.test.ts +0 -353
- package/tests/sanitizer.test.ts +0 -358
- package/tests/search.test.ts +0 -456
- package/tests/threat-reporter.test.ts +0 -334
- package/tsconfig.cdk.json +0 -35
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: Bug Report
|
|
3
|
-
about: Something isn't working correctly
|
|
4
|
-
title: '[BUG] '
|
|
5
|
-
labels: bug
|
|
6
|
-
assignees: ''
|
|
7
|
-
---
|
|
8
|
-
|
|
9
|
-
## Describe the bug
|
|
10
|
-
|
|
11
|
-
A clear description of what went wrong.
|
|
12
|
-
|
|
13
|
-
## Tool used
|
|
14
|
-
|
|
15
|
-
- [ ] visus_fetch
|
|
16
|
-
- [ ] visus_read
|
|
17
|
-
- [ ] visus_search
|
|
18
|
-
- [ ] visus_fetch_structured
|
|
19
|
-
|
|
20
|
-
## To Reproduce
|
|
21
|
-
|
|
22
|
-
1. Tool call (URL and parameters — remove any sensitive URLs)
|
|
23
|
-
2. Expected output
|
|
24
|
-
3. Actual output
|
|
25
|
-
|
|
26
|
-
## Sanitization metadata
|
|
27
|
-
|
|
28
|
-
Paste the `sanitization` block from the tool response if relevant.
|
|
29
|
-
|
|
30
|
-
```json
|
|
31
|
-
{
|
|
32
|
-
"patterns_detected": [],
|
|
33
|
-
"pii_types_redacted": [],
|
|
34
|
-
"content_modified": false
|
|
35
|
-
}
|
|
36
|
-
```
|
|
37
|
-
|
|
38
|
-
## Environment
|
|
39
|
-
|
|
40
|
-
- visus-mcp version: (run `npx visus-mcp --version`)
|
|
41
|
-
- Node.js version: (run `node --version`)
|
|
42
|
-
- OS: (macOS / Windows / Linux)
|
|
43
|
-
- Claude Desktop version (if applicable):
|
|
44
|
-
|
|
45
|
-
## Additional context
|
|
46
|
-
|
|
47
|
-
Any other relevant information.
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: False Positive Report
|
|
3
|
-
about: visus incorrectly flagged or redacted legitimate content
|
|
4
|
-
title: '[FALSE POSITIVE] '
|
|
5
|
-
labels: false-positive, sanitizer
|
|
6
|
-
assignees: ''
|
|
7
|
-
---
|
|
8
|
-
|
|
9
|
-
## What was incorrectly flagged?
|
|
10
|
-
|
|
11
|
-
Describe the legitimate content that was redacted or blocked.
|
|
12
|
-
Do NOT include sensitive URLs or private content.
|
|
13
|
-
|
|
14
|
-
## Pattern category that fired
|
|
15
|
-
|
|
16
|
-
Which pattern triggered? (visible in the `patterns_detected` field of the sanitization metadata)
|
|
17
|
-
|
|
18
|
-
Pattern name: `pattern_name_here`
|
|
19
|
-
|
|
20
|
-
## Example of the content
|
|
21
|
-
|
|
22
|
-
A minimal example of the text that triggered the false positive.
|
|
23
|
-
Keep it short — just enough to reproduce the pattern match.
|
|
24
|
-
|
|
25
|
-
```
|
|
26
|
-
Example content here
|
|
27
|
-
```
|
|
28
|
-
|
|
29
|
-
## Expected behavior
|
|
30
|
-
|
|
31
|
-
What should visus have done with this content?
|
|
32
|
-
|
|
33
|
-
## Domain context
|
|
34
|
-
|
|
35
|
-
What type of site was this? (news, documentation, health info, government, etc.) — helps assess if a domain-scoped allowlist is appropriate.
|
|
36
|
-
|
|
37
|
-
Domain type: ___
|
|
38
|
-
|
|
39
|
-
## visus-mcp version
|
|
40
|
-
|
|
41
|
-
Run `npx visus-mcp --version`:
|
|
42
|
-
|
|
43
|
-
Version: ___
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: New Injection Pattern Request
|
|
3
|
-
about: Suggest a new prompt injection pattern category
|
|
4
|
-
title: '[PATTERN] '
|
|
5
|
-
labels: enhancement, sanitizer
|
|
6
|
-
assignees: ''
|
|
7
|
-
---
|
|
8
|
-
|
|
9
|
-
## Pattern description
|
|
10
|
-
|
|
11
|
-
What type of injection attack does this detect?
|
|
12
|
-
|
|
13
|
-
## Example of malicious content
|
|
14
|
-
|
|
15
|
-
A concrete example of what this pattern should catch.
|
|
16
|
-
(These examples are for security research — they will be added to the test corpus.)
|
|
17
|
-
|
|
18
|
-
**Example 1 (should be caught):**
|
|
19
|
-
```
|
|
20
|
-
[paste example here]
|
|
21
|
-
```
|
|
22
|
-
|
|
23
|
-
**Example 2 (should NOT be caught — negative case):**
|
|
24
|
-
```
|
|
25
|
-
[paste legitimate content that looks similar but is safe]
|
|
26
|
-
```
|
|
27
|
-
|
|
28
|
-
## Proposed severity level
|
|
29
|
-
|
|
30
|
-
- [ ] CRITICAL — Immediate threat, direct instruction manipulation
|
|
31
|
-
- [ ] HIGH — Significant obfuscation or context manipulation
|
|
32
|
-
- [ ] MEDIUM — Moderate risk, indirect attack vectors
|
|
33
|
-
- [ ] LOW — Low risk, informational flag
|
|
34
|
-
|
|
35
|
-
## Framework mapping (if known)
|
|
36
|
-
|
|
37
|
-
- OWASP LLM Top 10: (e.g. LLM01:2025)
|
|
38
|
-
- NIST AI 600-1: (e.g. MS-2.5)
|
|
39
|
-
- MITRE ATLAS: (e.g. AML.T0051)
|
|
40
|
-
- ISO/IEC 42001: (e.g. A.6.1.5)
|
|
41
|
-
|
|
42
|
-
## Real-world context
|
|
43
|
-
|
|
44
|
-
Where have you seen this pattern used? (CVE, research paper, red team exercise, etc.)
|
|
45
|
-
|
|
46
|
-
## Are you willing to submit a PR?
|
|
47
|
-
|
|
48
|
-
- [ ] Yes, I'll implement and test this pattern
|
|
49
|
-
- [ ] No, but I can provide more examples if needed
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: Security Vulnerability
|
|
3
|
-
about: Report a security vulnerability in visus-mcp
|
|
4
|
-
title: '[SECURITY] '
|
|
5
|
-
labels: security
|
|
6
|
-
assignees: ''
|
|
7
|
-
---
|
|
8
|
-
|
|
9
|
-
# ⚠️ STOP — Do not file public security issues.
|
|
10
|
-
|
|
11
|
-
If you have found a security vulnerability in visus-mcp, please report it **privately**:
|
|
12
|
-
|
|
13
|
-
📧 **Email:** security@lateos.ai
|
|
14
|
-
|
|
15
|
-
🔒 **GitHub Security Advisories:**
|
|
16
|
-
https://github.com/visus-mcp/visus-mcp/security/advisories/new
|
|
17
|
-
|
|
18
|
-
## Include in your report:
|
|
19
|
-
|
|
20
|
-
- Description of the vulnerability
|
|
21
|
-
- Steps to reproduce
|
|
22
|
-
- Potential impact
|
|
23
|
-
- Suggested fix (optional)
|
|
24
|
-
|
|
25
|
-
We aim to respond within **48 hours** and will credit you in SECURITY.md once the issue is resolved.
|
|
26
|
-
|
|
27
|
-
Thank you for helping keep visus-mcp secure.
|
|
28
|
-
|
|
29
|
-
---
|
|
30
|
-
|
|
31
|
-
**Do not proceed with this public issue template for security vulnerabilities.**
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
## What does this PR do?
|
|
2
|
-
|
|
3
|
-
Brief description of the change.
|
|
4
|
-
|
|
5
|
-
## Type of change
|
|
6
|
-
|
|
7
|
-
- [ ] New injection pattern
|
|
8
|
-
- [ ] False positive fix
|
|
9
|
-
- [ ] Bug fix
|
|
10
|
-
- [ ] Feature addition
|
|
11
|
-
- [ ] Documentation update
|
|
12
|
-
- [ ] Performance improvement
|
|
13
|
-
|
|
14
|
-
## Test results
|
|
15
|
-
|
|
16
|
-
- [ ] npm test passes (all tests)
|
|
17
|
-
- [ ] npm run build compiles cleanly
|
|
18
|
-
- [ ] New tests added for new functionality
|
|
19
|
-
- [ ] Test count did not decrease
|
|
20
|
-
|
|
21
|
-
**Before:** X/X tests passing
|
|
22
|
-
**After:** X/X tests passing
|
|
23
|
-
|
|
24
|
-
## Security checklist
|
|
25
|
-
|
|
26
|
-
- [ ] All new content passes through the sanitizer pipeline
|
|
27
|
-
- [ ] No new `any` types introduced
|
|
28
|
-
- [ ] No console.log (use structured stderr logging)
|
|
29
|
-
- [ ] No hardcoded secrets or API keys
|
|
30
|
-
- [ ] CLAUDE.md security rules not violated
|
|
31
|
-
|
|
32
|
-
## Does this change affect sanitization coverage?
|
|
33
|
-
|
|
34
|
-
- [ ] No
|
|
35
|
-
- [ ] Yes — explain: ___
|
|
36
|
-
|
|
37
|
-
## Related issues
|
|
38
|
-
|
|
39
|
-
Closes #___
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
ghu_9xbQ1SXXZ8bh3BmoTNB21qUfmu31cJ0ly3mc
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"token":"eyJhbGciOiJFZERTQSIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJtY3AtcmVnaXN0cnkiLCJleHAiOjE3NzQzMDc2MzIsIm5iZiI6MTc3NDMwNzMzMiwiaWF0IjoxNzc0MzA3MzMyLCJhdXRoX21ldGhvZCI6ImdpdGh1Yi1hdCIsImF1dGhfbWV0aG9kX3N1YiI6Imxlb2Nob25nIiwicGVybWlzc2lvbnMiOlt7ImFjdGlvbiI6InB1Ymxpc2giLCJyZXNvdXJjZSI6ImlvLmdpdGh1Yi5sZW9jaG9uZy8qIn0seyJhY3Rpb24iOiJwdWJsaXNoIiwicmVzb3VyY2UiOiJpby5naXRodWIudmlzdXMtbWNwLyoifV19.qXNypXv1OF_l3ob4Kju46rvn-vs4s5x3JIU2ZH7jJiaBV5gy0sX60NJSKM9ybJvcXggnW9_Mp1L-JeZDPVd5BQ","expires_at":1774307632}
|
package/CONTRIBUTING.md
DELETED
|
@@ -1,329 +0,0 @@
|
|
|
1
|
-
# Contributing to Visus
|
|
2
|
-
|
|
3
|
-
Thank you for considering contributing to Visus! This project is security-first — all contributions must maintain the sanitization guarantees that protect users. Visus is engineered, not vibe-coded. We expect rigorous testing, clear documentation, and adherence to security best practices.
|
|
4
|
-
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
## What We're Looking For
|
|
8
|
-
|
|
9
|
-
The most valuable contributions to Visus are:
|
|
10
|
-
|
|
11
|
-
- **New injection pattern categories** (most wanted) — Validated detection patterns for emerging prompt injection techniques
|
|
12
|
-
- **False positive reports** — Cases where Visus incorrectly flags or redacts legitimate content
|
|
13
|
-
- **New PII redaction types** — Additional personally identifiable information patterns (passports, driver's licenses, medical IDs, etc.)
|
|
14
|
-
- **Performance improvements** — Optimizations to the sanitizer pipeline that maintain coverage
|
|
15
|
-
- **Documentation improvements** — Clearer explanations, better examples, tutorial content
|
|
16
|
-
- **Bug reports with reproduction steps** — Detailed reports that help us quickly identify and fix issues
|
|
17
|
-
|
|
18
|
-
### What is OUT OF SCOPE
|
|
19
|
-
|
|
20
|
-
To avoid wasted effort, please **do not submit PRs** for:
|
|
21
|
-
|
|
22
|
-
- Changes that reduce sanitization coverage or allow bypassing the pipeline
|
|
23
|
-
- New tools that don't run content through the sanitizer
|
|
24
|
-
- Dependencies that require Python runtime (Visus is TypeScript-only)
|
|
25
|
-
- Modifications to the security rules defined in CLAUDE.md
|
|
26
|
-
- Changes that introduce `any` types or violate TypeScript strict mode
|
|
27
|
-
|
|
28
|
-
---
|
|
29
|
-
|
|
30
|
-
## How to Add a New Injection Pattern
|
|
31
|
-
|
|
32
|
-
This is the most important contribution type. Follow these steps carefully:
|
|
33
|
-
|
|
34
|
-
### Step 1: Add the pattern definition
|
|
35
|
-
|
|
36
|
-
Open `src/sanitizer/patterns.ts` and add your pattern to the `INJECTION_PATTERNS` array. Each pattern requires:
|
|
37
|
-
|
|
38
|
-
```typescript
|
|
39
|
-
{
|
|
40
|
-
name: 'your_pattern_name', // snake_case identifier
|
|
41
|
-
description: 'What this detects', // Brief explanation
|
|
42
|
-
regex: /pattern_here/gi, // Detection regex (case-insensitive)
|
|
43
|
-
severity: 'critical', // critical | high | medium | low
|
|
44
|
-
action: 'redact' // strip | redact | escape
|
|
45
|
-
}
|
|
46
|
-
```
|
|
47
|
-
|
|
48
|
-
**Example pattern:**
|
|
49
|
-
```typescript
|
|
50
|
-
{
|
|
51
|
-
name: 'unicode_normalization_attack',
|
|
52
|
-
description: 'Uses Unicode normalization to hide instructions',
|
|
53
|
-
regex: /\u0041\u0301.*\b(ignore|admin)\b/gi, // Á (decomposed) hiding text
|
|
54
|
-
severity: 'high',
|
|
55
|
-
action: 'strip'
|
|
56
|
-
}
|
|
57
|
-
```
|
|
58
|
-
|
|
59
|
-
### Step 2: Add severity classification
|
|
60
|
-
|
|
61
|
-
Open `src/sanitizer/severity-classifier.ts` and add your pattern category to the correct severity level:
|
|
62
|
-
|
|
63
|
-
```typescript
|
|
64
|
-
case 'your_pattern_name':
|
|
65
|
-
return 'CRITICAL'; // or HIGH, MEDIUM, LOW
|
|
66
|
-
```
|
|
67
|
-
|
|
68
|
-
### Step 3: Add framework mappings
|
|
69
|
-
|
|
70
|
-
Open `src/sanitizer/framework-mapper.ts` and add mappings for all four compliance frameworks:
|
|
71
|
-
|
|
72
|
-
```typescript
|
|
73
|
-
your_pattern_name: {
|
|
74
|
-
owasp_llm: 'LLM01:2025 - Prompt Injection',
|
|
75
|
-
nist_ai_600_1: 'MS-2.5 - Prompt Injection',
|
|
76
|
-
mitre_atlas: 'AML.T0051.000 - LLM Prompt Injection',
|
|
77
|
-
iso_42001: 'A.6.1.5 - AI System Security (Adversarial Input)'
|
|
78
|
-
},
|
|
79
|
-
```
|
|
80
|
-
|
|
81
|
-
**How to choose mappings:**
|
|
82
|
-
- **OWASP LLM Top 10**: See [OWASP LLM Top 10 (2025)](https://owasp.org/www-project-top-10-for-large-language-model-applications/)
|
|
83
|
-
- **NIST AI 600-1**: See [NIST AI 600-1 Controls](https://csrc.nist.gov/pubs/ai/600/1/final)
|
|
84
|
-
- **MITRE ATLAS**: See [MITRE ATLAS Tactics](https://atlas.mitre.org/)
|
|
85
|
-
- **ISO/IEC 42001**: Use Annex A controls (A.X.X format)
|
|
86
|
-
|
|
87
|
-
### Step 4: Add test cases
|
|
88
|
-
|
|
89
|
-
Open `tests/sanitizer.test.ts` and add at least two test cases:
|
|
90
|
-
|
|
91
|
-
**Positive case** (content that SHOULD be caught):
|
|
92
|
-
```typescript
|
|
93
|
-
it('should detect your_pattern_name', () => {
|
|
94
|
-
const result = sanitize('Malicious content here that triggers pattern');
|
|
95
|
-
expect(result.patterns_detected).toContain('your_pattern_name');
|
|
96
|
-
expect(result.content_modified).toBe(true);
|
|
97
|
-
});
|
|
98
|
-
```
|
|
99
|
-
|
|
100
|
-
**Negative case** (legitimate content that should NOT be caught):
|
|
101
|
-
```typescript
|
|
102
|
-
it('should NOT flag legitimate content as your_pattern_name', () => {
|
|
103
|
-
const result = sanitize('Legitimate content that looks similar but is safe');
|
|
104
|
-
expect(result.patterns_detected).not.toContain('your_pattern_name');
|
|
105
|
-
expect(result.content_modified).toBe(false);
|
|
106
|
-
});
|
|
107
|
-
```
|
|
108
|
-
|
|
109
|
-
**Why negative cases matter:** False positives erode trust. Always test that your pattern doesn't fire on legitimate content.
|
|
110
|
-
|
|
111
|
-
### Step 5: Run tests
|
|
112
|
-
|
|
113
|
-
```bash
|
|
114
|
-
npm test
|
|
115
|
-
```
|
|
116
|
-
|
|
117
|
-
All tests must pass (100% pass rate). If any tests fail, fix them before submitting.
|
|
118
|
-
|
|
119
|
-
### Step 6: Update SECURITY.md
|
|
120
|
-
|
|
121
|
-
Add your pattern to the appropriate severity section in `SECURITY.md` with an example:
|
|
122
|
-
|
|
123
|
-
```markdown
|
|
124
|
-
**XX. Your Pattern Name**
|
|
125
|
-
- **Example**: "Text that triggers the pattern"
|
|
126
|
-
- **Action**: Redact/Strip/Escape
|
|
127
|
-
```
|
|
128
|
-
|
|
129
|
-
---
|
|
130
|
-
|
|
131
|
-
## How to Report a False Positive
|
|
132
|
-
|
|
133
|
-
A **false positive** occurs when Visus incorrectly flags or redacts legitimate, non-malicious content. These are **high priority bugs** because they impact usability.
|
|
134
|
-
|
|
135
|
-
**To report a false positive:**
|
|
136
|
-
|
|
137
|
-
1. Open a **"False Positive Report"** issue using the GitHub issue template
|
|
138
|
-
2. Include:
|
|
139
|
-
- The URL or content that triggered the false positive (sanitize if sensitive)
|
|
140
|
-
- Which pattern category fired (visible in `patterns_detected` field)
|
|
141
|
-
- What the expected behavior should be
|
|
142
|
-
- Domain context (news site, documentation, health info, government, etc.)
|
|
143
|
-
3. **Do NOT include:**
|
|
144
|
-
- Sensitive URLs or private content in public issues
|
|
145
|
-
- Personally identifiable information
|
|
146
|
-
|
|
147
|
-
We take false positives seriously and will prioritize fixes.
|
|
148
|
-
|
|
149
|
-
---
|
|
150
|
-
|
|
151
|
-
## Development Setup
|
|
152
|
-
|
|
153
|
-
### Prerequisites
|
|
154
|
-
|
|
155
|
-
- **Node.js** 18+ and npm
|
|
156
|
-
- **Git** for version control
|
|
157
|
-
- **macOS / Windows**: No additional setup required
|
|
158
|
-
- **Linux**: Playwright requires system libraries (see README.md)
|
|
159
|
-
|
|
160
|
-
### Clone and Install
|
|
161
|
-
|
|
162
|
-
```bash
|
|
163
|
-
git clone https://github.com/visus-mcp/visus-mcp.git
|
|
164
|
-
cd visus-mcp
|
|
165
|
-
npm install
|
|
166
|
-
npm run build
|
|
167
|
-
npm test
|
|
168
|
-
```
|
|
169
|
-
|
|
170
|
-
**Note about Playwright:** The first run will download Chromium (~170MB). This is normal.
|
|
171
|
-
|
|
172
|
-
**Note about macOS iCloud:** If you use iCloud Drive, develop in `~/Projects`, NOT `~/Documents`. iCloud sync can interfere with node_modules.
|
|
173
|
-
|
|
174
|
-
---
|
|
175
|
-
|
|
176
|
-
## Running Tests
|
|
177
|
-
|
|
178
|
-
```bash
|
|
179
|
-
npm test # Full test suite (all 274+ tests)
|
|
180
|
-
npm test -- --watch # Watch mode for active development
|
|
181
|
-
npm test sanitizer # Run sanitizer tests only
|
|
182
|
-
npm test -- --coverage # Generate coverage report
|
|
183
|
-
```
|
|
184
|
-
|
|
185
|
-
**Test requirements:**
|
|
186
|
-
- All PRs must pass 100% of existing tests
|
|
187
|
-
- New functionality must include new tests
|
|
188
|
-
- Test count should never decrease
|
|
189
|
-
- Minimum 80% code coverage
|
|
190
|
-
|
|
191
|
-
---
|
|
192
|
-
|
|
193
|
-
## Security Vulnerability Reporting
|
|
194
|
-
|
|
195
|
-
**DO NOT open public issues for security vulnerabilities.**
|
|
196
|
-
|
|
197
|
-
If you discover a security vulnerability in Visus (e.g., a way to bypass the sanitizer, extract PII, or compromise the system):
|
|
198
|
-
|
|
199
|
-
📧 **Email:** security@lateos.ai
|
|
200
|
-
|
|
201
|
-
Include in your report:
|
|
202
|
-
- Description of the vulnerability
|
|
203
|
-
- Steps to reproduce
|
|
204
|
-
- Potential impact assessment
|
|
205
|
-
- Suggested fix (optional)
|
|
206
|
-
|
|
207
|
-
We aim to respond within 48 hours and will work with you on a coordinated disclosure timeline (typically 90 days).
|
|
208
|
-
|
|
209
|
-
See [SECURITY.md](./SECURITY.md) for the full disclosure policy.
|
|
210
|
-
|
|
211
|
-
---
|
|
212
|
-
|
|
213
|
-
## Pull Request Process
|
|
214
|
-
|
|
215
|
-
### Before Opening a PR
|
|
216
|
-
|
|
217
|
-
1. **Fork the repo** and create a feature branch:
|
|
218
|
-
```bash
|
|
219
|
-
git checkout -b feature/your-feature-name
|
|
220
|
-
```
|
|
221
|
-
|
|
222
|
-
2. **Make your changes** with tests:
|
|
223
|
-
- Write code following TypeScript strict mode
|
|
224
|
-
- Add test cases for new functionality
|
|
225
|
-
- Update documentation if needed
|
|
226
|
-
|
|
227
|
-
3. **Run the test suite**:
|
|
228
|
-
```bash
|
|
229
|
-
npm test
|
|
230
|
-
```
|
|
231
|
-
All tests must pass (100% success rate).
|
|
232
|
-
|
|
233
|
-
4. **Run the build**:
|
|
234
|
-
```bash
|
|
235
|
-
npm run build
|
|
236
|
-
```
|
|
237
|
-
TypeScript must compile cleanly with zero errors.
|
|
238
|
-
|
|
239
|
-
5. **Update STATUS.md** if adding a new feature:
|
|
240
|
-
- Add your feature to the current version section
|
|
241
|
-
- Use consistent formatting with existing entries
|
|
242
|
-
|
|
243
|
-
### Opening the PR
|
|
244
|
-
|
|
245
|
-
1. Push your branch to your fork
|
|
246
|
-
2. Open a PR against the `main` branch
|
|
247
|
-
3. Use the PR template and fill out all sections
|
|
248
|
-
4. Include a clear description of **what** changed and **why**
|
|
249
|
-
5. Reference any related issues (e.g., "Closes #123")
|
|
250
|
-
|
|
251
|
-
### PR Review Criteria
|
|
252
|
-
|
|
253
|
-
Your PR will be reviewed for:
|
|
254
|
-
|
|
255
|
-
- ✅ **Test coverage** — All existing tests pass, new tests added
|
|
256
|
-
- ✅ **TypeScript compliance** — No `any` types, strict mode passes
|
|
257
|
-
- ✅ **Security** — Sanitizer pipeline not bypassed
|
|
258
|
-
- ✅ **Documentation** — Code is well-commented and clear
|
|
259
|
-
- ✅ **Performance** — No significant latency regressions
|
|
260
|
-
|
|
261
|
-
**PRs that will NOT be merged:**
|
|
262
|
-
- ❌ Reduce test count or coverage
|
|
263
|
-
- ❌ Bypass the sanitizer pipeline
|
|
264
|
-
- ❌ Introduce `any` types or disable strict mode
|
|
265
|
-
- ❌ Break existing functionality
|
|
266
|
-
|
|
267
|
-
---
|
|
268
|
-
|
|
269
|
-
## Code Style
|
|
270
|
-
|
|
271
|
-
### TypeScript Conventions
|
|
272
|
-
|
|
273
|
-
- **TypeScript strict mode** — No `any` types allowed (use `unknown` if necessary)
|
|
274
|
-
- **Explicit return types** — All functions must declare return types
|
|
275
|
-
- **JSDoc comments** — All public functions must have JSDoc documentation
|
|
276
|
-
- **Error handling** — Never throw raw errors; return typed Result objects
|
|
277
|
-
|
|
278
|
-
### MCP Tool Registration
|
|
279
|
-
|
|
280
|
-
All new tools must register with proper MCP annotations:
|
|
281
|
-
|
|
282
|
-
```typescript
|
|
283
|
-
{
|
|
284
|
-
name: 'tool_name',
|
|
285
|
-
description: 'What this tool does',
|
|
286
|
-
readOnlyHint: true, // If tool doesn't modify state
|
|
287
|
-
destructiveHint: false, // If tool could cause data loss
|
|
288
|
-
idempotentHint: true, // If repeated calls have same effect
|
|
289
|
-
openWorldHint: false // If tool accesses external resources
|
|
290
|
-
}
|
|
291
|
-
```
|
|
292
|
-
|
|
293
|
-
### Logging
|
|
294
|
-
|
|
295
|
-
- **Structured JSON** to stderr only (never `console.log`)
|
|
296
|
-
- **Never log PII** — Use field redaction for sensitive data
|
|
297
|
-
- **Use timestamps** in ISO 8601 format
|
|
298
|
-
|
|
299
|
-
**Example:**
|
|
300
|
-
```typescript
|
|
301
|
-
console.error(JSON.stringify({
|
|
302
|
-
timestamp: new Date().toISOString(),
|
|
303
|
-
event: 'sanitization_completed',
|
|
304
|
-
patterns_detected: ['role_hijacking'],
|
|
305
|
-
content_modified: true
|
|
306
|
-
}));
|
|
307
|
-
```
|
|
308
|
-
|
|
309
|
-
---
|
|
310
|
-
|
|
311
|
-
## Recognition
|
|
312
|
-
|
|
313
|
-
Contributors who add validated injection patterns that are merged into the main branch will be credited in:
|
|
314
|
-
|
|
315
|
-
- **SECURITY.md** under "Community Patterns"
|
|
316
|
-
- **Release notes** for the version that includes their pattern
|
|
317
|
-
- **GitHub Contributors** page
|
|
318
|
-
|
|
319
|
-
We deeply appreciate the security research community's contributions to making Visus more robust.
|
|
320
|
-
|
|
321
|
-
---
|
|
322
|
-
|
|
323
|
-
## Questions?
|
|
324
|
-
|
|
325
|
-
- **General questions**: Open a [GitHub Discussion](https://github.com/visus-mcp/visus-mcp/discussions)
|
|
326
|
-
- **Bug reports**: Use the [Bug Report issue template](https://github.com/visus-mcp/visus-mcp/issues/new?template=bug_report.md)
|
|
327
|
-
- **Security issues**: Email security@lateos.ai (do NOT open public issues)
|
|
328
|
-
|
|
329
|
-
**Built with by Lateos**
|