@clear-capabilities/agentic-security-scanner 0.162.0 → 0.163.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/CHANGELOG.md +26 -0
- package/bin/agentic-security.js +87 -0
- package/dist/1340.index.js +1871 -0
- package/dist/3477.index.js +727 -0
- package/dist/3499.index.js +23 -3
- package/dist/4113.index.js +1 -1
- package/dist/5014.index.js +833 -0
- package/dist/5756.index.js +2 -2
- package/dist/6257.index.js +1 -1
- package/dist/6907.index.js +248 -0
- package/dist/6994.index.js +1 -1
- package/dist/7033.index.js +33 -5
- package/dist/7439.index.js +1822 -0
- package/dist/7838.index.js +1 -1
- package/dist/9560.index.js +2318 -23
- package/dist/957.index.js +1 -1
- package/dist/9999.index.js +43 -7
- package/dist/agentic-security.mjs +12 -12
- package/dist/agentic-security.mjs.sha256 +1 -1
- package/package.json +33 -6
- package/src/capabilities/CLAUDE.md +114 -0
- package/src/capabilities/address.js +73 -0
- package/src/capabilities/attack-coverage.js +93 -0
- package/src/capabilities/decide.js +256 -0
- package/src/capabilities/delegate.js +69 -0
- package/src/capabilities/egress.js +20 -0
- package/src/capabilities/hook-advice.js +50 -0
- package/src/capabilities/index.js +32 -0
- package/src/capabilities/manifest.js +344 -0
- package/src/capabilities/outbound.js +189 -0
- package/src/capabilities/paths.js +57 -0
- package/src/capabilities/probes.js +211 -0
- package/src/capabilities/proxy.js +182 -0
- package/src/capabilities/reasons.js +67 -0
- package/src/capabilities/receipts.js +356 -0
- package/src/capabilities/records.js +58 -0
- package/src/capabilities/recovery.js +367 -0
- package/src/capabilities/report.js +81 -0
- package/src/capabilities/runner.js +236 -0
- package/src/capabilities/secrets.js +26 -0
- package/src/capabilities/tool-gate.js +119 -0
- package/src/capabilities/tool-registry.js +60 -0
- package/src/dataflow/CLAUDE.md +29 -0
- package/src/dataflow/catalog.js +21 -0
- package/src/dataflow/engine.js +20 -0
- package/src/dataflow/guard-dominance.js +352 -0
- package/src/discovery/CLAUDE.md +9 -0
- package/src/discovery/index.js +15 -1
- package/src/discovery/lenses.js +18 -0
- package/src/engine.js +80 -15
- package/src/integrations/index.js +5 -2
- package/src/ir/CLAUDE.md +14 -0
- package/src/ir/implicit-handler-params.js +74 -0
- package/src/ir/parser-cs.js +20 -0
- package/src/ir/parser-go.js +30 -13
- package/src/ir/parser-java.js +11 -0
- package/src/language/nix-eval-isolation.js +33 -5
- package/src/lineage/CLAUDE.md +31 -0
- package/src/lineage/deployment/adapter-cloud.js +202 -0
- package/src/lineage/deployment/adapter-compose.js +90 -0
- package/src/lineage/deployment/adapter-kit.js +142 -0
- package/src/lineage/deployment/adapter-kubernetes.js +247 -0
- package/src/lineage/deployment/attack-paths.js +443 -0
- package/src/lineage/deployment/boundaries-run.js +223 -0
- package/src/lineage/deployment/boundary-graph.js +567 -0
- package/src/lineage/deployment/cross-repo.js +253 -0
- package/src/lineage/deployment/drift.js +383 -0
- package/src/lineage/deployment/ingest.js +221 -0
- package/src/lineage/deployment/projection.js +244 -0
- package/src/lineage/deployment/trace-correlation.js +541 -0
- package/src/lineage/source-registry.js +19 -0
- package/src/mcp/CLAUDE.md +5 -2
- package/src/mcp/invariant-tools.js +64 -0
- package/src/mcp/portfolio-tools.js +79 -0
- package/src/mcp/redact.js +15 -0
- package/src/mcp/server.js +24 -3
- package/src/mcp/tools.js +13 -1
- package/src/posture/CLAUDE.md +332 -1
- package/src/posture/accuracy-scorecard.js +95 -4
- package/src/posture/assurance/rollback.js +214 -0
- package/src/posture/assurance/rollout.js +200 -0
- package/src/posture/business-logic.js +26 -4
- package/src/posture/evaluation/bakeoff.js +148 -0
- package/src/posture/evaluation/custody.js +200 -0
- package/src/posture/evaluation/deployment-ablation.js +416 -0
- package/src/posture/evaluation/dev-cases.js +65 -0
- package/src/posture/evaluation/economics.js +85 -0
- package/src/posture/evaluation/gates.js +161 -0
- package/src/posture/evaluation/grouping.js +101 -0
- package/src/posture/evaluation/interval.js +132 -0
- package/src/posture/evaluation/invariant-ablation.js +325 -0
- package/src/posture/evaluation/labels.js +200 -0
- package/src/posture/evaluation/protocol.js +308 -0
- package/src/posture/evaluation/release-gate.js +209 -0
- package/src/posture/evaluation/report.js +158 -0
- package/src/posture/evaluation/runner.js +273 -0
- package/src/posture/evaluation/scan-child.js +80 -0
- package/src/posture/evaluation/score.js +174 -0
- package/src/posture/evaluation/synthetic.js +90 -0
- package/src/posture/evaluation/why-missed.js +219 -0
- package/src/posture/fleet.js +11 -2
- package/src/posture/invariants/cli.js +95 -0
- package/src/posture/invariants/coverage.js +164 -0
- package/src/posture/invariants/export.js +178 -0
- package/src/posture/invariants/expressions.js +46 -0
- package/src/posture/invariants/lifecycle.js +289 -0
- package/src/posture/invariants/project-input.js +55 -0
- package/src/posture/invariants/repair.js +340 -0
- package/src/posture/invariants/run.js +45 -0
- package/src/posture/invariants/scenarios.js +311 -0
- package/src/posture/invariants/schema.js +167 -0
- package/src/posture/invariants/shrink.js +407 -0
- package/src/posture/invariants/state-assertions.js +165 -0
- package/src/posture/logic-claims.js +12 -0
- package/src/posture/model-routing.js +40 -0
- package/src/posture/oracles/adapters.js +172 -1
- package/src/posture/oracles/conformance.js +3 -2
- package/src/posture/oracles/oracle.js +23 -3
- package/src/posture/oracles/registry.js +1 -1
- package/src/posture/portfolio/backend.js +279 -0
- package/src/posture/portfolio/bundle.js +314 -0
- package/src/posture/portfolio/cli.js +142 -0
- package/src/posture/portfolio/manifest.js +263 -0
- package/src/posture/portfolio/progress.js +267 -0
- package/src/posture/portfolio/resume.js +130 -0
- package/src/posture/portfolio/retention.js +207 -0
- package/src/posture/portfolio/scheduler.js +488 -0
- package/src/posture/portfolio/signing.js +155 -0
- package/src/posture/portfolio/wording.js +59 -0
- package/src/posture/portfolio/work-units.js +405 -0
- package/src/posture/replay/replay.js +1 -0
- package/src/posture/routing/adapter.js +140 -0
- package/src/posture/routing/calibration.js +278 -0
- package/src/posture/routing/canary.js +141 -0
- package/src/posture/routing/control.js +35 -0
- package/src/posture/routing/decide.js +211 -0
- package/src/posture/routing/drift.js +137 -0
- package/src/posture/routing/economics.js +185 -0
- package/src/posture/routing/feedback.js +207 -0
- package/src/posture/routing/index.js +31 -0
- package/src/posture/routing/outcomes.js +281 -0
- package/src/posture/routing/promotion.js +291 -0
- package/src/posture/routing/receipts.js +59 -0
- package/src/posture/routing/report.js +142 -0
- package/src/posture/routing/shadow.js +53 -0
- package/src/posture/specification-mining.js +26 -0
- package/src/posture/verification/patch-negative.js +16 -4
- package/src/posture/verification/patch-promotion.js +10 -2
- package/src/report/index.js +51 -1
- package/src/sandbox/CLAUDE.md +10 -0
- package/src/sandbox/backend-userspace.js +91 -13
- package/dist/5613.index.js +0 -500
- package/dist/6239.index.js +0 -469
package/dist/957.index.js
CHANGED
|
@@ -10,7 +10,7 @@ export const modules = {
|
|
|
10
10
|
/* harmony export */ proposeOllamaExplanation: () => (/* binding */ proposeOllamaExplanation)
|
|
11
11
|
/* harmony export */ });
|
|
12
12
|
/* unused harmony export buildExplainPrompt */
|
|
13
|
-
/* harmony import */ var _egress_redact_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(
|
|
13
|
+
/* harmony import */ var _egress_redact_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(11723);
|
|
14
14
|
/* harmony import */ var _egress_policy_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(45712);
|
|
15
15
|
/* harmony import */ var _providers_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(38947);
|
|
16
16
|
/* harmony import */ var _ollama_provider_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(23837);
|
package/dist/9999.index.js
CHANGED
|
@@ -503,7 +503,7 @@ async function runHunter(focusArea, lens, ctx = {}, opts = {}) {
|
|
|
503
503
|
|
|
504
504
|
let prompt;
|
|
505
505
|
try {
|
|
506
|
-
prompt = (0,discovery_lenses/* buildHunterPrompt */.
|
|
506
|
+
prompt = (0,discovery_lenses/* buildHunterPrompt */.jM)(focusArea, lens, ctx);
|
|
507
507
|
} catch (err) {
|
|
508
508
|
const reason = `failed to build hunter prompt: ${err?.message || String(err)}`;
|
|
509
509
|
appendEntry(transcript, { phase: 'prompt_error', reason });
|
|
@@ -959,8 +959,8 @@ function forgetRefuted(memory) {
|
|
|
959
959
|
|
|
960
960
|
// EXTERNAL MODULE: ./src/posture/verification/emit.js
|
|
961
961
|
var emit = __webpack_require__(85578);
|
|
962
|
-
// EXTERNAL MODULE: ./src/posture/oracles/oracle.js +
|
|
963
|
-
var oracle = __webpack_require__(
|
|
962
|
+
// EXTERNAL MODULE: ./src/posture/oracles/oracle.js + 1 modules
|
|
963
|
+
var oracle = __webpack_require__(14642);
|
|
964
964
|
// EXTERNAL MODULE: ./src/posture/assurance/verification-record.js
|
|
965
965
|
var verification_record = __webpack_require__(29668);
|
|
966
966
|
// EXTERNAL MODULE: ./src/posture/assurance/identity.js
|
|
@@ -1182,6 +1182,8 @@ function deepFreeze(o) {
|
|
|
1182
1182
|
return Object.freeze(o);
|
|
1183
1183
|
}
|
|
1184
1184
|
|
|
1185
|
+
// EXTERNAL MODULE: ./src/posture/assurance/config.js
|
|
1186
|
+
var config = __webpack_require__(90385);
|
|
1185
1187
|
;// CONCATENATED MODULE: ./src/discovery/index.js
|
|
1186
1188
|
//
|
|
1187
1189
|
// Compose the discovery pipeline:
|
|
@@ -1202,6 +1204,7 @@ function deepFreeze(o) {
|
|
|
1202
1204
|
|
|
1203
1205
|
|
|
1204
1206
|
|
|
1207
|
+
|
|
1205
1208
|
// Bridge a candidate to the deterministic layer. A taint finding at or within
|
|
1206
1209
|
// two lines of the candidate corroborates it; a modelled sink on the line
|
|
1207
1210
|
// without a full path is weaker corroboration ("sink-adjacent").
|
|
@@ -1344,7 +1347,7 @@ async function runDiscovery(ctx = {}, opts = {}) {
|
|
|
1344
1347
|
|
|
1345
1348
|
const lenses = [];
|
|
1346
1349
|
for (const key of lensKeys) {
|
|
1347
|
-
const lens = (0,discovery_lenses/* lensByKey */.
|
|
1350
|
+
const lens = (0,discovery_lenses/* lensByKey */.Hy)(key);
|
|
1348
1351
|
// An unknown key must degrade visibly, not vanish via a silent filter.
|
|
1349
1352
|
if (lens) lenses.push(lens);
|
|
1350
1353
|
else reasons.push(`unresolved lens key: "${key}"`);
|
|
@@ -1480,6 +1483,18 @@ async function runDiscovery(ctx = {}, opts = {}) {
|
|
|
1480
1483
|
if (e.ok) verificationRecords.push(e.record);
|
|
1481
1484
|
}
|
|
1482
1485
|
|
|
1486
|
+
// X-402: opt-in invariant proposals. A candidate from a state-oriented lens can suggest a contract; the suggestion is advisory,
|
|
1487
|
+
// `proposed`, authored by the model and never approved here. Off unless `opts.invariantProposals = { config }` and the
|
|
1488
|
+
// `invariant-scenarios` feature is enabled in that config.
|
|
1489
|
+
let invariantProposals = null;
|
|
1490
|
+
if (opts.invariantProposals && (0,config/* featureStatus */.FX)(opts.invariantProposals.config, 'invariant-scenarios').status === 'ok') {
|
|
1491
|
+
invariantProposals = [];
|
|
1492
|
+
for (const f of fresh) {
|
|
1493
|
+
const inv = (0,discovery_lenses/* invariantProposalFor */.gj)({ lens: f.discovery?.lens, title: f.vuln, description: f.description, file: f.file, line: f.line });
|
|
1494
|
+
if (inv) invariantProposals.push({ hypothesisId: f.stableId, invariant: inv });
|
|
1495
|
+
}
|
|
1496
|
+
}
|
|
1497
|
+
|
|
1483
1498
|
// X-207: opt-in promotion. A hypothesis crosses into a finding ONLY through `promoteHypothesis` (trusted verifier receipt,
|
|
1484
1499
|
// explicit policy, audit record). `fresh` is unchanged; promoted findings and every decision's audit record are reported
|
|
1485
1500
|
// separately, and nothing here writes `last-scan.json`. `opts.promote = { policy, verify(hypothesis) -> runOracle result }`.
|
|
@@ -1501,6 +1516,7 @@ async function runDiscovery(ctx = {}, opts = {}) {
|
|
|
1501
1516
|
fresh,
|
|
1502
1517
|
verificationRecords,
|
|
1503
1518
|
...(promotions ? { promotions } : {}),
|
|
1519
|
+
...(invariantProposals ? { invariantProposals } : {}),
|
|
1504
1520
|
duplicates,
|
|
1505
1521
|
suppressed,
|
|
1506
1522
|
// `refutedCandidates` holds RAW candidates straight from `disprovePanel`,
|
|
@@ -1559,11 +1575,13 @@ async function runDiscovery(ctx = {}, opts = {}) {
|
|
|
1559
1575
|
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
|
|
1560
1576
|
|
|
1561
1577
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
1562
|
-
/* harmony export */
|
|
1578
|
+
/* harmony export */ Hy: () => (/* binding */ lensByKey),
|
|
1563
1579
|
/* harmony export */ LENSES: () => (/* binding */ LENSES),
|
|
1564
|
-
/* harmony export */
|
|
1580
|
+
/* harmony export */ gj: () => (/* binding */ invariantProposalFor),
|
|
1581
|
+
/* harmony export */ jM: () => (/* binding */ buildHunterPrompt)
|
|
1565
1582
|
/* harmony export */ });
|
|
1566
|
-
/* harmony import */ var _egress_redact_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(
|
|
1583
|
+
/* harmony import */ var _egress_redact_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(11723);
|
|
1584
|
+
/* harmony import */ var _posture_invariants_lifecycle_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(80891);
|
|
1567
1585
|
//
|
|
1568
1586
|
// The seven hunting lenses. Each hunter run is one (focus area × lens) pair.
|
|
1569
1587
|
//
|
|
@@ -1574,6 +1592,7 @@ async function runDiscovery(ctx = {}, opts = {}) {
|
|
|
1574
1592
|
// no single prompt reaches. `wildcard` exists because a fixed taxonomy is a
|
|
1575
1593
|
// ceiling, and the classes worth finding are the ones not on the list.
|
|
1576
1594
|
|
|
1595
|
+
|
|
1577
1596
|
const LENSES = Object.freeze([
|
|
1578
1597
|
{ key: 'injection', title: 'Injection', family: 'injection', cwe: 'CWE-74',
|
|
1579
1598
|
brief: 'Untrusted input reaching an interpreter: SQL, shell, template, XPath, LDAP, or deserialization. Follow the value, not the function name.' },
|
|
@@ -1591,6 +1610,23 @@ const LENSES = Object.freeze([
|
|
|
1591
1610
|
brief: 'Anything the other lenses do not cover. Prefer the surprising and specific over the generic; report nothing rather than something already obvious.' },
|
|
1592
1611
|
]);
|
|
1593
1612
|
|
|
1613
|
+
// X-402: the lenses that reason about who may do what to whose data can propose an INVARIANT for a candidate they raise. The
|
|
1614
|
+
// proposal is a skeleton contract authored by the model (`proposed`, with the candidate as source evidence and a high uncertainty),
|
|
1615
|
+
// advisory until a reviewer approves it in the signed ledger. A lens whose candidates are not about state (injection, crypto) has
|
|
1616
|
+
// no mapping and proposes nothing.
|
|
1617
|
+
const TENANT_HINT = /tenant|idor|ownership|object reference|cross[- ]?(?:account|user|org)|leak|another user|other user/i;
|
|
1618
|
+
const WORKFLOW_HINT = /refund|order|status|workflow|state machine|out[- ]of[- ]order|step|approval|checkout|paid|ship/i;
|
|
1619
|
+
|
|
1620
|
+
function invariantProposalFor(candidate) {
|
|
1621
|
+
const text = `${candidate?.title || ''} ${candidate?.description || ''} ${candidate?.rationale || ''}`;
|
|
1622
|
+
let cls = null;
|
|
1623
|
+
if (candidate?.lens === 'authz') cls = TENANT_HINT.test(text) ? 'tenant-isolation' : 'privilege-constraint';
|
|
1624
|
+
else if (candidate?.lens === 'feature-abuse' && TENANT_HINT.test(text)) cls = 'tenant-isolation';
|
|
1625
|
+
else if (candidate?.lens === 'business-logic' && WORKFLOW_HINT.test(text)) cls = 'workflow-order';
|
|
1626
|
+
if (!cls || typeof candidate.file !== 'string') return null;
|
|
1627
|
+
return (0,_posture_invariants_lifecycle_js__WEBPACK_IMPORTED_MODULE_1__/* .inferredInvariant */ .mB)({ class: cls, source: 'discovery-lens', evidence: { file: candidate.file, line: Number.isInteger(candidate.line) ? candidate.line : null, lens: candidate.lens }, uncertainty: 0.85 });
|
|
1628
|
+
}
|
|
1629
|
+
|
|
1594
1630
|
function lensByKey(key) {
|
|
1595
1631
|
if (typeof key !== 'string') return null;
|
|
1596
1632
|
return LENSES.find(l => l.key === key) || null;
|