Skip to content

Commit 350b351

Browse files
author
Vish Devarajan
committed
Futuristic Security Layers
1 parent 15365da commit 350b351

5 files changed

Lines changed: 982 additions & 16 deletions

File tree

README.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,14 @@ Links: [Comparison guide](./wiki/Blackwall-vs-OpenAI-Moderation.md) | [Contribut
3838
- Sanitizes retrieval documents for RAG pipelines
3939
- Records signed audit events and dashboard models
4040
- Supports canary tokens, synthetic PII replacement, optional spaCy/Presidio detectors, built-in red-team playbooks, and framework helpers
41+
- Enforces intent sovereignty with cognitive locks when reasoning or tool plans drift from user intent
42+
- Redacts untrusted image metadata and OCR text with cross-modal environment-injection defense
43+
- Issues task-scoped agent passports and verifies MCP/tool actions against zero-trust identity boundaries
44+
- Supports agentic JWT-style identity exchange and capability-manifest enforcement at the tool boundary
45+
- Blocks business-logic abuse with workflow-state validation before high-impact actions execute
46+
- Shares decaying signatory antigens through an adaptive threat mesh instead of relying only on static rule updates
47+
- Ships an `agent_governance` preset and `AutonomousAdversarialAuditor` for control-plane style agent security
48+
- Adds swarm-grade governance primitives like Byzantine consensus, alignment credit ledgers, worldview routing, and truth reflection
4149

4250
## Install
4351

@@ -102,6 +110,14 @@ Enterprise deployments can also enrich emitted events with SSO/user context and
102110

103111
`OutputFirewall` can compare a response to retrieval documents and flag unsupported claims or unprofessional tone before the answer leaves your service.
104112

113+
### Autonomous governance and agent security
114+
115+
Use `IntentSovereigntyEngine` to detect reasoning drift and trigger a cognitive lock before a tool call happens. Pair `CrossModalConsistencyGuard` with `ImageMetadataScanner` and `VisualInstructionDetector` when your app ingests screenshots, OCR, alt text, or other perceptual inputs that may carry indirect instructions.
116+
117+
For autonomous agents, combine `AgentIdentityRegistry`, `MCPSecurityProxy`, and task-scoped passports so tools verify what the agent is allowed to do instead of trusting the model's final text alone. Use `AdaptiveThreatMesh` to export and import decaying signatory antigens across deployments, and run `BehavioralChaosEngineer` to continuously red-team your current shield configuration under controlled failure scenarios.
118+
119+
For stateful business workflows, add `WorkflowStateGuard` to `ToolPermissionFirewall` so high-impact actions like transfers, sends, or deletes require prior approvals, recorded sequence steps, and evidence keys before execution is even considered.
120+
105121
### Lightweight integrations
106122

107123
Use `BlackwallFastAPIMiddleware`, `create_flask_middleware()`, `create_langchain_callbacks()`, or `create_llamaindex_callback()` to wire Blackwall into framework or orchestration entry points with less glue code.
@@ -157,6 +173,7 @@ Recommended presets:
157173
- `document_intake` for upload-heavy intake and review flows
158174
- `citizen_services` for identity-aware service delivery workflows
159175
- `internal_ops_agent` for internal operational assistants with shadow-first defaults
176+
- `agent_governance` for zero-trust agent identity, business-logic validation, and high-sensitivity tool workflows
160177

161178
### Global Governance Pack
162179

@@ -170,6 +187,16 @@ The 0.5.0 line also adds globally applicable enterprise controls that are useful
170187
- `detect_operational_drift()` for release-over-release noise monitoring
171188
- `ConversationThreatTracker`, `shield.use(plugin)`, `generate_coverage_report()`, and `unvault()` for multi-turn defense, ecosystem extensions, OWASP reporting, and reversible PII workflows
172189
- `AdversarialMutationEngine`, `PromptProvenanceGraph`, and `LiteBlackwallShield` for corpus hardening, cross-hop tracing, and lightweight deployments
190+
- `IntentSovereigntyEngine` for cognitive locks when reasoning or planned tools drift from the original task
191+
- `CrossModalConsistencyGuard` for indirect prompt-injection defense across OCR, captions, and image metadata
192+
- `BehavioralChaosEngineer` for built-in continuous chaos-style red-teaming
193+
- `AutonomousAdversarialAuditor` for packaged ghost-agent scenarios that probe passports, workflow skips, and retrieval abuse
194+
- `ByzantineSwarmConsensus` for BFT-style approval over agent swarms with malicious-node isolation
195+
- `AlignmentCreditLedger` for incentive-style scoring of transparent reasoning vs. capability hiding
196+
- `WorldviewPolicyRouter` for locale/domain-specific moral anchors and institutional norms
197+
- `TruthSovereignReflector` for hidden adversarial self-critique before trusting a final answer
198+
- `AgentIdentityRegistry.issue_signed_passport()`, `verify_task_scope()`, and `issue_passport_token()` for task-scoped zero-trust agent identity
199+
- `AdaptiveThreatMesh.export_signatory_antigens()` and `import_signatory_antigens()` for distributed threat learning across fleets
173200

174201
## Example Workflow
175202

pyproject.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
44

55
[project]
66
name = "blackwall-llm-shield-python"
7-
version = "0.6.6"
7+
version = "0.6.11"
88
description = "Security middleware for Python LLM apps and services. Blocks prompt injection, masks PII, inspects outputs, and gates agent tools."
99
readme = "README.md"
1010
requires-python = ">=3.9"
@@ -36,8 +36,8 @@ classifiers = [
3636
Homepage = "https://github.com/vpdeva/blackwall-llm-shield-python"
3737
Repository = "https://github.com/vpdeva/blackwall-llm-shield-python"
3838
Issues = "https://github.com/vpdeva/blackwall-llm-shield-python/issues"
39-
Documentation = "https://vish.au"
40-
Funding = "https://vish.au"
39+
Documentation = "https://github.com/vpdeva/blackwall-llm-shield-python/wiki"
40+
Funding = "https://buymeacoffee.com/vishdevarae"
4141

4242
[project.optional-dependencies]
4343
integrations = ["fastapi>=0.115.0", "flask>=3.0.0", "langchain-core>=0.3.0"]

src/blackwall_llm_shield/__init__.py

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,21 @@
33
ApprovalInboxModel,
44
AgenticCapabilityGater,
55
AgentIdentityRegistry,
6+
AdaptiveThreatMesh,
67
AdversarialMutationEngine,
8+
AlignmentCreditLedger,
9+
AutonomousAdversarialAuditor,
710
BlackwallFastAPIMiddleware,
811
BlackwallShield,
12+
BehavioralChaosEngineer,
913
CoTScanner,
1014
ConversationThreatTracker,
15+
CrossModalConsistencyGuard,
1116
CrossModelConsensusWrapper,
1217
DataClassificationGate,
18+
ByzantineSwarmConsensus,
1319
DigitalTwinOrchestrator,
20+
HoneyContextDeceptionPack,
1421
ImageMetadataScanner,
1522
LightweightIntentScorer,
1623
MCPSecurityProxy,
@@ -29,6 +36,7 @@
2936
ToolPermissionFirewall,
3037
ValueAtRiskCircuitBreaker,
3138
VisualInstructionDetector,
39+
WorldviewPolicyRouter,
3240
SHIELD_PRESETS,
3341
CORE_INTERFACES,
3442
POLICY_PACKS,
@@ -46,23 +54,32 @@
4654
create_canary_token,
4755
create_presidio_entity_detector,
4856
create_spacy_entity_detector,
57+
calculate_shannon_entropy,
4958
deobfuscate_text,
5059
detect_canary_leakage,
5160
detect_prompt_injection,
61+
detect_structural_anomaly,
5262
export_local_rehydration_bundle,
5363
generate_coverage_report,
5464
get_red_team_prompt_library,
5565
inject_canary_tokens,
5666
inspect_tone,
67+
IntentSovereigntyEngine,
5768
mask_messages,
5869
mask_text,
5970
mask_value,
6071
normalize_messages,
6172
normalize_identity_metadata,
6273
parse_json_output,
6374
PolicyLearningLoop,
75+
PolymorphicVault,
6476
PowerBIExporter,
6577
PromptProvenanceGraph,
78+
PromptFingerprintEngine,
79+
TemporalSandboxOrchestrator,
80+
TruthSovereignReflector,
81+
WorkflowStateGuard,
82+
generate_deception_payload,
6683
sanitize_audit_event,
6784
detect_operational_drift,
6885
detect_enterprise_findings,
@@ -99,7 +116,11 @@
99116
"ApprovalInboxModel",
100117
"AgenticCapabilityGater",
101118
"AgentIdentityRegistry",
119+
"AdaptiveThreatMesh",
102120
"AdversarialMutationEngine",
121+
"AlignmentCreditLedger",
122+
"AutonomousAdversarialAuditor",
123+
"BehavioralChaosEngineer",
103124
"BlackwallFastAPIMiddleware",
104125
"BlackwallLangChainCallback",
105126
"BlackwallLlamaIndexCallback",
@@ -108,10 +129,13 @@
108129
"LiteBlackwallShield",
109130
"CoTScanner",
110131
"ConversationThreatTracker",
132+
"CrossModalConsistencyGuard",
111133
"CORE_INTERFACES",
112134
"CrossModelConsensusWrapper",
113135
"DataClassificationGate",
136+
"ByzantineSwarmConsensus",
114137
"DigitalTwinOrchestrator",
138+
"HoneyContextDeceptionPack",
115139
"FastTextIntentScorer",
116140
"ImageMetadataScanner",
117141
"LightweightIntentScorer",
@@ -131,6 +155,7 @@
131155
"ToolPermissionFirewall",
132156
"ValueAtRiskCircuitBreaker",
133157
"VisualInstructionDetector",
158+
"WorldviewPolicyRouter",
134159
"POLICY_PACKS",
135160
"ProviderAdapter",
136161
"SHIELD_PRESETS",
@@ -148,14 +173,17 @@
148173
"create_canary_token",
149174
"create_presidio_entity_detector",
150175
"create_spacy_entity_detector",
176+
"calculate_shannon_entropy",
151177
"deobfuscate_text",
152178
"detect_canary_leakage",
153179
"detect_prompt_injection",
180+
"detect_structural_anomaly",
154181
"export_local_rehydration_bundle",
155182
"generate_coverage_report",
156183
"get_red_team_prompt_library",
157184
"inject_canary_tokens",
158185
"inspect_tone",
186+
"IntentSovereigntyEngine",
159187
"load_local_intent_scorer",
160188
"mask_messages",
161189
"mask_text",
@@ -164,8 +192,14 @@
164192
"normalize_identity_metadata",
165193
"parse_json_output",
166194
"PolicyLearningLoop",
195+
"PolymorphicVault",
167196
"PowerBIExporter",
168197
"PromptProvenanceGraph",
198+
"PromptFingerprintEngine",
199+
"TemporalSandboxOrchestrator",
200+
"TruthSovereignReflector",
201+
"WorkflowStateGuard",
202+
"generate_deception_payload",
169203
"sanitize_audit_event",
170204
"detect_operational_drift",
171205
"detect_enterprise_findings",

0 commit comments

Comments
 (0)