You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit afc2cc6
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: README.md
+9-3Lines changed: 9 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,7 @@ Monorepo for managed CPEX plugins that are implemented in Rust and published as
4
4
5
5
## Runtime Requirements
6
6
7
-
These packages target the CPEX release-candidate framework API and intentionally depend on `cpex>=0.1.0rc1,<0.2`. The RC dependency is the migration target for this repository; it is not an accidental pre-stable dependency.
7
+
These packages target the CPEX 0.1 framework API and intentionally depend on `cpex>=0.1.0,<0.2`.
8
8
9
9
Rust plugin packages require their compiled PyO3 extension at import/runtime. They do not ship Python fallback implementations for missing Rust extensions.
10
10
@@ -14,8 +14,14 @@ Managed plugins live under `plugins/rust/python-package/<slug>/`.
14
14
15
15
Current plugins:
16
16
17
-
-`rate_limiter`
18
-
-`pii_filter`
17
+
| Plugin | Package | Purpose |
18
+
|---|---|---|
19
+
|`encoded_exfil_detection`|`cpex-encoded-exfil-detection`| Detect suspicious encoded payload exfiltration patterns in prompt arguments, tool output, and resource content |
20
+
|`pii_filter`|`cpex-pii-filter`| Detect and mask PII in nested payloads |
21
+
|`rate_limiter`|`cpex-rate-limiter`| Enforce per-user, per-tenant, and per-tool rate limits |
22
+
|`retry_with_backoff`|`cpex-retry-with-backoff`| Apply retry policy and exponential backoff metadata to transient failures |
23
+
|`secrets_detection`|`cpex-secrets-detection`| Detect and redact likely credentials in prompt arguments, tool inputs and outputs, and resource content |
24
+
|`url_reputation`|`cpex-url-reputation`| Apply static URL allowlist, blocklist, pattern, and heuristic checks before resource fetches |
Copy file name to clipboardExpand all lines: plugins/rust/python-package/encoded_exfil_detection/README.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -25,7 +25,7 @@ make install
25
25
26
26
## Runtime Requirements
27
27
28
-
This plugin depends on `cpex>=0.1.0rc1,<0.2` and imports hook models from `cpex.framework`. The compiled Rust extension is mandatory; there is no Python fallback implementation.
28
+
This plugin depends on `cpex>=0.1.0,<0.2` and imports hook models from `cpex.framework`. The compiled Rust extension is mandatory; there is no Python fallback implementation.
Copy file name to clipboardExpand all lines: plugins/rust/python-package/pii_filter/README.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -22,7 +22,7 @@ make install
22
22
23
23
## Runtime Requirements
24
24
25
-
This plugin depends on `cpex>=0.1.0rc1,<0.2` and imports hook models from `cpex.framework`. The compiled Rust extension is mandatory; there is no Python fallback implementation.
25
+
This plugin depends on `cpex>=0.1.0,<0.2` and imports hook models from `cpex.framework`. The compiled Rust extension is mandatory; there is no Python fallback implementation.
Copy file name to clipboardExpand all lines: plugins/rust/python-package/rate_limiter/README.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,7 +6,7 @@ Enforces rate limits per user, tenant, and tool across `tool_pre_invoke` and `pr
6
6
7
7
## Runtime Requirements
8
8
9
-
This plugin depends on `cpex>=0.1.0rc1,<0.2` and imports hook models from `cpex.framework`. The compiled Rust extension is mandatory; there is no Python fallback implementation.
9
+
This plugin depends on `cpex>=0.1.0,<0.2` and imports hook models from `cpex.framework`. The compiled Rust extension is mandatory; there is no Python fallback implementation.
Copy file name to clipboardExpand all lines: plugins/rust/python-package/retry_with_backoff/README.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -20,7 +20,7 @@ make install
20
20
21
21
## Runtime Requirements
22
22
23
-
This plugin depends on `cpex>=0.1.0rc1,<0.2` and imports hook models from `cpex.framework`. The compiled Rust extension is mandatory; there is no Python fallback implementation.
23
+
This plugin depends on `cpex>=0.1.0,<0.2` and imports hook models from `cpex.framework`. The compiled Rust extension is mandatory; there is no Python fallback implementation.
Rust-backed secrets detection plugin for MCP Gateway / CPEX.
3
+
Rust-backed secrets detection and redaction for ContextForge and MCP Gateway.
4
4
5
-
## Runtime Requirements
5
+
## Features
6
+
7
+
- Detects likely credentials in prompt arguments, tool inputs, tool outputs, and resource content
8
+
- Built-in detectors for AWS keys, Google API keys, GitHub tokens, Stripe keys, Slack tokens, and private key blocks
9
+
- Optional broad detectors for generic API key assignments, JWT-like strings, long hex strings, and base64-like secrets
10
+
- Blocking, redaction, or metadata-only reporting modes
11
+
- Recursive scanning for nested dicts, lists, tuples, Pydantic-style objects, `__dict__`, and `__slots__`
12
+
- Sanitized outward metadata that reports finding types and counts, not original secret values
6
13
7
-
This plugin depends on `cpex>=0.1.0rc1,<0.2` and imports hook models from `cpex.framework`. The compiled Rust extension is mandatory; there is no Python fallback implementation.
14
+
## Build
15
+
16
+
```bash
17
+
make install
18
+
```
8
19
9
-
## What it does
20
+
## Runtime Requirements
10
21
11
-
This plugin scans hook payloads for likely secrets and can either:
22
+
This plugin depends on `cpex>=0.1.0,<0.2` and imports hook models from `cpex.framework`. The compiled Rust extension is mandatory; there is no Python fallback implementation.
12
23
13
-
- block processing when a secret is found
14
-
- redact matched values in the returned payload
15
-
- attach findings metadata to the hook result
24
+
## Usage
16
25
17
-
Supported hooks:
26
+
The plugin scans these hooks:
18
27
19
28
-`prompt_pre_fetch`: scans `payload.args`
29
+
-`tool_pre_invoke`: scans tool invocation payloads before execution
It walks nested values, not just top-level strings. Coverage includes:
33
+
Typical uses:
24
34
25
-
- plain strings
26
-
-`dict`
27
-
-`list`
28
-
-`tuple`
29
-
- custom Python objects with `__dict__`
30
-
- slot-based objects with `__slots__`
31
-
- Pydantic-style objects that expose `model_dump()` and `model_copy()`
35
+
- block requests that contain likely credentials before they reach tools or prompts
36
+
- redact secrets from returned tool or resource payloads
37
+
- surface sanitized findings metadata for observability and tuning
32
38
33
-
When redaction is enabled, the plugin preserves payload shape as much as possible instead of flattening everything to plain dicts.
39
+
## Detection Coverage
34
40
35
-
## Exact detector coverage
36
-
37
-
The plugin ships these regex-based detectors:
41
+
Enabled by default:
38
42
39
43
-`aws_access_key_id`
40
44
-`aws_secret_access_key`
@@ -43,92 +47,72 @@ The plugin ships these regex-based detectors:
43
47
-`stripe_secret_key`
44
48
-`slack_token`
45
49
-`private_key_block`
50
+
51
+
Disabled by default because they are broader and more false-positive-prone:
52
+
46
53
-`generic_api_key_assignment`
47
54
-`jwt_like`
48
55
-`hex_secret_32`
49
56
-`base64_24`
50
57
51
-
Default behavior:
52
-
53
-
- enabled by default:
54
-
-`aws_access_key_id`
55
-
-`aws_secret_access_key`
56
-
-`google_api_key`
57
-
-`github_token`
58
-
-`stripe_secret_key`
59
-
-`slack_token`
60
-
-`private_key_block`
61
-
- disabled by default because they are broader and more false-positive-prone:
62
-
-`generic_api_key_assignment`
63
-
-`jwt_like`
64
-
-`hex_secret_32`
65
-
-`base64_24`
66
-
67
-
## What it does not do
68
-
69
-
This plugin is intentionally narrow. It does not:
70
-
71
-
- verify whether a matched credential is real, active, or revoked
72
-
- call external services
73
-
- decode or unpack data before scanning
74
-
- no base64 decode pass
75
-
- no hex decode pass
76
-
- no gzip, zip, or archive inspection
77
-
- scan binary resource bodies
78
-
-`resource_post_fetch` only scans `content.text`
79
-
- inspect arbitrary object internals unless they are exposed through supported Python state surfaces such as `model_dump()`, `__dict__`, or `__slots__`
80
-
- guarantee detection of every secret format
81
-
- coverage is limited to the listed regex patterns
82
-
- use entropy scoring, ML classification, or semantic analysis
83
-
- infer secret validity from surrounding prose
84
-
85
-
It also does not emit the original matched secret in outward-facing findings metadata or violation examples. Those surfaces contain secret types only.
86
-
87
-
## Config
88
-
89
-
Available config keys:
90
-
91
-
-`enabled`: map of detector name to `true` or `false`
92
-
-`redact`: whether to replace matches in returned payloads
93
-
-`redaction_text`: replacement text used when `redact=true`
94
-
-`block_on_detection`: whether to stop processing on detection
95
-
-`min_findings_to_block`: threshold for blocking
96
-
97
-
Defaults:
58
+
The detectors are regex-based. They do not verify whether a credential is real, active, or revoked.
0 commit comments