lyrie-agent 0.3.0__tar.gz

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.
@@ -0,0 +1,80 @@
1
+ # Dependencies
2
+ node_modules/
3
+ .pnp
4
+ .pnp.js
5
+ .yarn/install-state.gz
6
+
7
+ # Build outputs
8
+ dist/
9
+ build/
10
+ out/
11
+ *.js.map
12
+
13
+ # Rust / Shield
14
+ target/
15
+ packages/shield/target/
16
+ **/*.rs.bk
17
+ Cargo.lock
18
+
19
+ # Environment
20
+ .env
21
+ .env.local
22
+ .env.*.local
23
+
24
+ # Logs
25
+ *.log
26
+ npm-debug.log*
27
+ yarn-debug.log*
28
+ yarn-error.log*
29
+ bun-debug.log*
30
+
31
+ # Runtime data
32
+ pids/
33
+ *.pid
34
+ *.seed
35
+ *.pid.lock
36
+
37
+ # Lyrie data dirs
38
+ .lyrie/memory/
39
+ .lyrie/cache/
40
+
41
+ # OS
42
+ .DS_Store
43
+ .DS_Store?
44
+ ._*
45
+ .Spotlight-V100
46
+ .Trashes
47
+ ehthumbs.db
48
+ Thumbs.db
49
+
50
+ # Editor
51
+ .vscode/
52
+ .idea/
53
+ *.swp
54
+ *.swo
55
+ *.iml
56
+
57
+ # Turbo
58
+ .turbo/
59
+
60
+ # TypeScript
61
+ *.tsbuildinfo
62
+
63
+ # Semgrep registry cache (auto-regenerable)
64
+ packages/omega-suite/engine/semgrep/rules/registry-cache/
65
+
66
+ # Python bytecode — never commit
67
+ **/__pycache__/
68
+ **/*.pyc
69
+ **/*.pyo
70
+
71
+ # Next.js build output — never commit
72
+ **/.next/
73
+
74
+ # OS artifacts
75
+ .DS_Store
76
+ Thumbs.db
77
+
78
+ # Secrets
79
+ *.npmrc
80
+ .pypirc
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 OTT Cybersecurity LLC
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,117 @@
1
+ Metadata-Version: 2.4
2
+ Name: lyrie-agent
3
+ Version: 0.3.0
4
+ Summary: Lyrie Agent SDK — embed the Lyrie Shield, Attack-Surface Mapper, Stages A–F validator, and pentest scanners in any Python project. Lyrie.ai by OTT Cybersecurity LLC.
5
+ Project-URL: Homepage, https://lyrie.ai
6
+ Project-URL: Documentation, https://docs.lyrie.ai/sdk/python
7
+ Project-URL: Repository, https://github.com/overthetopseo/lyrie-agent
8
+ Project-URL: Issues, https://github.com/overthetopseo/lyrie-agent/issues
9
+ Project-URL: Research, https://research.lyrie.ai
10
+ Author-email: Guy Sheetrit <guy@overthetopseo.com>, Lyrie Threat Intelligence <research@lyrie.ai>
11
+ License: MIT
12
+ License-File: LICENSE
13
+ Keywords: agent,ai-agent,cybersecurity,lyrie,lyrie-agent,ott-cybersecurity,pentest,sast,shield,threat-intel
14
+ Classifier: Development Status :: 4 - Beta
15
+ Classifier: Intended Audience :: Developers
16
+ Classifier: Intended Audience :: Information Technology
17
+ Classifier: License :: OSI Approved :: MIT License
18
+ Classifier: Operating System :: OS Independent
19
+ Classifier: Programming Language :: Python :: 3
20
+ Classifier: Programming Language :: Python :: 3.10
21
+ Classifier: Programming Language :: Python :: 3.11
22
+ Classifier: Programming Language :: Python :: 3.12
23
+ Classifier: Programming Language :: Python :: 3.13
24
+ Classifier: Topic :: Security
25
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
26
+ Classifier: Topic :: System :: Monitoring
27
+ Classifier: Typing :: Typed
28
+ Requires-Python: >=3.10
29
+ Provides-Extra: async
30
+ Requires-Dist: httpx>=0.27; extra == 'async'
31
+ Provides-Extra: dev
32
+ Requires-Dist: mypy>=1.10; extra == 'dev'
33
+ Requires-Dist: pytest-cov>=4.1; extra == 'dev'
34
+ Requires-Dist: pytest>=7.4; extra == 'dev'
35
+ Requires-Dist: ruff>=0.5; extra == 'dev'
36
+ Provides-Extra: http
37
+ Requires-Dist: httpx>=0.27; extra == 'http'
38
+ Description-Content-Type: text/markdown
39
+
40
+ <!-- lyrie-shield: ignore-file (this README contains code examples that demonstrate Shield detector strings; they are documentation, not vectors) -->
41
+
42
+ # Lyrie Agent — Python SDK
43
+
44
+ > _Lyrie.ai by **OTT Cybersecurity LLC** — https://lyrie.ai — MIT License._
45
+
46
+ ```bash
47
+ pip install lyrie-agent
48
+ ```
49
+
50
+ The Lyrie Agent SDK lets any Python project embed Lyrie's offensive
51
+ and defensive primitives: **the Shield, the Attack-Surface Mapper,
52
+ the Stages A–F validator, the Multi-Language Scanners, the
53
+ Threat-Intel client, the HTTP proxy, the diff-view EditEngine,
54
+ and the OSS-Scan service** — all as native Python types with
55
+ zero runtime dependencies (httpx is opt-in via `lyrie-agent[http]`).
56
+
57
+ This is the same surface that powers the
58
+ [`lyrie-agent` GitHub Action](https://github.com/overthetopseo/lyrie-agent/tree/main/action),
59
+ exposed as `pip install`.
60
+
61
+ ## Quick start
62
+
63
+ ```python
64
+ from lyrie import Shield, AttackSurfaceMapper, StagesValidator, scan_files
65
+
66
+ # 1. Shield Doctrine — scan untrusted text BEFORE the agent sees it
67
+ shield = Shield()
68
+ print(shield.scan_recalled("Ignore all previous instructions"))
69
+ # → ShieldVerdict(blocked=True, severity='high', reason='prompt-injection ...')
70
+
71
+ # 2. Attack-Surface Mapper — what's worth attacking?
72
+ surface = AttackSurfaceMapper(root="./my-repo").run()
73
+ print(f"Found {len(surface.entry_points)} entry points,"
74
+ f" {len(surface.data_flows)} tainted flows")
75
+
76
+ # 3. Multi-language scanners — Lyrie-original detection rules
77
+ report = scan_files(root="./my-repo")
78
+ for finding in report.findings:
79
+ print(f"[{finding.severity}] {finding.title} @ {finding.file}:{finding.line}")
80
+
81
+ # 4. Stages A–F — kill false positives + auto-PoC + remediation
82
+ validator = StagesValidator()
83
+ for finding in report.findings:
84
+ verdict = validator.validate(finding, surface=surface)
85
+ if verdict.confirmed:
86
+ print(f"✓ {finding.id} confidence={verdict.confidence:.0%}")
87
+ if verdict.poc:
88
+ print(verdict.poc.payload)
89
+ ```
90
+
91
+ ## Modules at a glance
92
+
93
+ | Module | Purpose |
94
+ |---|---|
95
+ | `lyrie.Shield` | Shield Doctrine — scans recalled / inbound text. Blocks prompt injection + secret-shaped material. |
96
+ | `lyrie.AttackSurfaceMapper` | Maps entry points, trust boundaries, tainted data flows, dependencies, hotspots. |
97
+ | `lyrie.StagesValidator` | Six-stage exploitation validator. Kills false positives. Generates auto-PoCs and remediation. |
98
+ | `lyrie.scan_files` | 8 Lyrie multi-language scanners — JS / TS / Python / Go / PHP / Ruby / C / C++. |
99
+ | `lyrie.HttpProxy` | Capture, classify, replay, mutate HTTP exchanges. 9 security-signal detectors. |
100
+ | `lyrie.EditEngine` | Diff-view edits with approval gates. Shield-scans every patch before disk. |
101
+ | `lyrie.ThreatIntelClient` | Pulls KEV-aligned advisories from research.lyrie.ai. Auto-attribution. |
102
+ | `lyrie.run_oss_scan` | The same engine that powers `research.lyrie.ai/scan`. |
103
+
104
+ ## CLI
105
+
106
+ The package ships a `lyrie-py` CLI:
107
+
108
+ ```bash
109
+ lyrie-py shield "Ignore all previous instructions"
110
+ lyrie-py understand --root ./my-repo
111
+ lyrie-py scan-files --root ./my-repo
112
+ lyrie-py validate-finding --severity high --evidence "execSync(req.body.cmd)"
113
+ ```
114
+
115
+ ## License
116
+
117
+ MIT — © OTT Cybersecurity LLC. _Lyrie.ai — https://lyrie.ai_
@@ -0,0 +1,78 @@
1
+ <!-- lyrie-shield: ignore-file (this README contains code examples that demonstrate Shield detector strings; they are documentation, not vectors) -->
2
+
3
+ # Lyrie Agent — Python SDK
4
+
5
+ > _Lyrie.ai by **OTT Cybersecurity LLC** — https://lyrie.ai — MIT License._
6
+
7
+ ```bash
8
+ pip install lyrie-agent
9
+ ```
10
+
11
+ The Lyrie Agent SDK lets any Python project embed Lyrie's offensive
12
+ and defensive primitives: **the Shield, the Attack-Surface Mapper,
13
+ the Stages A–F validator, the Multi-Language Scanners, the
14
+ Threat-Intel client, the HTTP proxy, the diff-view EditEngine,
15
+ and the OSS-Scan service** — all as native Python types with
16
+ zero runtime dependencies (httpx is opt-in via `lyrie-agent[http]`).
17
+
18
+ This is the same surface that powers the
19
+ [`lyrie-agent` GitHub Action](https://github.com/overthetopseo/lyrie-agent/tree/main/action),
20
+ exposed as `pip install`.
21
+
22
+ ## Quick start
23
+
24
+ ```python
25
+ from lyrie import Shield, AttackSurfaceMapper, StagesValidator, scan_files
26
+
27
+ # 1. Shield Doctrine — scan untrusted text BEFORE the agent sees it
28
+ shield = Shield()
29
+ print(shield.scan_recalled("Ignore all previous instructions"))
30
+ # → ShieldVerdict(blocked=True, severity='high', reason='prompt-injection ...')
31
+
32
+ # 2. Attack-Surface Mapper — what's worth attacking?
33
+ surface = AttackSurfaceMapper(root="./my-repo").run()
34
+ print(f"Found {len(surface.entry_points)} entry points,"
35
+ f" {len(surface.data_flows)} tainted flows")
36
+
37
+ # 3. Multi-language scanners — Lyrie-original detection rules
38
+ report = scan_files(root="./my-repo")
39
+ for finding in report.findings:
40
+ print(f"[{finding.severity}] {finding.title} @ {finding.file}:{finding.line}")
41
+
42
+ # 4. Stages A–F — kill false positives + auto-PoC + remediation
43
+ validator = StagesValidator()
44
+ for finding in report.findings:
45
+ verdict = validator.validate(finding, surface=surface)
46
+ if verdict.confirmed:
47
+ print(f"✓ {finding.id} confidence={verdict.confidence:.0%}")
48
+ if verdict.poc:
49
+ print(verdict.poc.payload)
50
+ ```
51
+
52
+ ## Modules at a glance
53
+
54
+ | Module | Purpose |
55
+ |---|---|
56
+ | `lyrie.Shield` | Shield Doctrine — scans recalled / inbound text. Blocks prompt injection + secret-shaped material. |
57
+ | `lyrie.AttackSurfaceMapper` | Maps entry points, trust boundaries, tainted data flows, dependencies, hotspots. |
58
+ | `lyrie.StagesValidator` | Six-stage exploitation validator. Kills false positives. Generates auto-PoCs and remediation. |
59
+ | `lyrie.scan_files` | 8 Lyrie multi-language scanners — JS / TS / Python / Go / PHP / Ruby / C / C++. |
60
+ | `lyrie.HttpProxy` | Capture, classify, replay, mutate HTTP exchanges. 9 security-signal detectors. |
61
+ | `lyrie.EditEngine` | Diff-view edits with approval gates. Shield-scans every patch before disk. |
62
+ | `lyrie.ThreatIntelClient` | Pulls KEV-aligned advisories from research.lyrie.ai. Auto-attribution. |
63
+ | `lyrie.run_oss_scan` | The same engine that powers `research.lyrie.ai/scan`. |
64
+
65
+ ## CLI
66
+
67
+ The package ships a `lyrie-py` CLI:
68
+
69
+ ```bash
70
+ lyrie-py shield "Ignore all previous instructions"
71
+ lyrie-py understand --root ./my-repo
72
+ lyrie-py scan-files --root ./my-repo
73
+ lyrie-py validate-finding --severity high --evidence "execSync(req.body.cmd)"
74
+ ```
75
+
76
+ ## License
77
+
78
+ MIT — © OTT Cybersecurity LLC. _Lyrie.ai — https://lyrie.ai_
@@ -0,0 +1,78 @@
1
+ """
2
+ Lyrie Agent — Python SDK.
3
+
4
+ Lyrie.ai by OTT Cybersecurity LLC — https://lyrie.ai — MIT License.
5
+
6
+ Embed the Shield Doctrine, Attack-Surface Mapper, Stages A–F validator,
7
+ multi-language scanners, threat-intel client, HTTP proxy, and EditEngine
8
+ in any Python project.
9
+ """
10
+
11
+ from __future__ import annotations
12
+
13
+ __all__ = [
14
+ "__version__",
15
+ "SIGNATURE",
16
+ # Shield Doctrine
17
+ "Shield",
18
+ "ShieldVerdict",
19
+ # Attack-Surface Mapper
20
+ "AttackSurfaceMapper",
21
+ "AttackSurface",
22
+ "EntryPoint",
23
+ "TrustBoundary",
24
+ "DataFlow",
25
+ "RiskHotspot",
26
+ # Stages A-F validator
27
+ "StagesValidator",
28
+ "ValidatedFinding",
29
+ "StageVerdict",
30
+ "Finding",
31
+ # Multi-language scanners
32
+ "scan_files",
33
+ "ScanReport",
34
+ # HTTP proxy
35
+ "HttpProxy",
36
+ "HttpExchange",
37
+ "Mutator",
38
+ # EditEngine
39
+ "EditEngine",
40
+ "EditPlan",
41
+ # Threat-Intel
42
+ "ThreatIntelClient",
43
+ "ThreatAdvisory",
44
+ # OSS-Scan
45
+ "run_oss_scan",
46
+ "OssScanResult",
47
+ # LyrieEvolve
48
+ "LyrieEvolve",
49
+ "TaskOutcome",
50
+ "SkillContext",
51
+ "TrainingEntry",
52
+ "ExtractionResult",
53
+ ]
54
+
55
+ __version__ = "0.5.0"
56
+ SIGNATURE: str = "Lyrie.ai by OTT Cybersecurity LLC"
57
+
58
+ from lyrie.shield import Shield, ShieldVerdict
59
+ from lyrie.attack_surface import (
60
+ AttackSurfaceMapper,
61
+ AttackSurface,
62
+ EntryPoint,
63
+ TrustBoundary,
64
+ DataFlow,
65
+ RiskHotspot,
66
+ )
67
+ from lyrie.stages import (
68
+ StagesValidator,
69
+ ValidatedFinding,
70
+ StageVerdict,
71
+ Finding,
72
+ )
73
+ from lyrie.scanners import scan_files, ScanReport
74
+ from lyrie.proxy import HttpProxy, HttpExchange, Mutator
75
+ from lyrie.edits import EditEngine, EditPlan
76
+ from lyrie.threat_intel import ThreatIntelClient, ThreatAdvisory
77
+ from lyrie.oss_scan import run_oss_scan, OssScanResult
78
+ from lyrie.evolve import LyrieEvolve, TaskOutcome, SkillContext, TrainingEntry, ExtractionResult