{"_id":"@agenteer/trust","_rev":"2-478bdfc9b50951a9641e06bd0a163888","name":"@agenteer/trust","dist-tags":{"latest":"1.0.0-rc.2"},"versions":{"1.0.0-rc.1":{"name":"@agenteer/trust","version":"1.0.0-rc.1","keywords":["agenteer","agent","evidence","structured-output","zod","cross-check","llm","trust","observability"],"author":{"url":"https://github.com/salehsquared","name":"salehsquared"},"license":"MIT","_id":"@agenteer/trust@1.0.0-rc.1","maintainers":[{"name":"salehsquared","email":"salehmostafamain@gmail.com"}],"homepage":"https://github.com/salehsquared/agenteer#readme","bugs":{"url":"https://github.com/salehsquared/agenteer/issues"},"dist":{"shasum":"7b19aa5ab192fbfb6af05f90c49c6b146e3bdece","tarball":"https://registry.npmjs.org/@agenteer/trust/-/trust-1.0.0-rc.1.tgz","fileCount":123,"integrity":"sha512-0DPnWKG89B7BDgBWUhYgscLYF77J1b/tMG55P0iBS/+oruIF0iQWd5XrYoujyrrOBA6I8RRv4Hz8no4u/+XeRQ==","signatures":[{"sig":"MEUCIDnXow31g9v7H6FdWA+scZS7Xmy56HbaZF0oxBTPrtsLAiEA3LTAc+Nws27RJgWZF0F+XrHmub1HuXdmkGpI8v4+x+M=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":281649},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","engines":{"node":">=20"},"exports":{".":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"./access":{"types":"./dist/access/index.d.ts","default":"./dist/access/index.js"},"./testing":{"types":"./dist/testing/index.d.ts","default":"./dist/testing/index.js"},"./evidence":{"types":"./dist/evidence/index.d.ts","default":"./dist/evidence/index.js"},"./crosscheck":{"types":"./dist/crosscheck/index.d.ts","default":"./dist/crosscheck/index.js"},"./structured":{"types":"./dist/structured/index.d.ts","default":"./dist/structured/index.js"}},"gitHead":"3cbe3b072857a24a3a496b120c69c4d01cc9a488","scripts":{"test":"vitest run","build":"tsc -b","typecheck":"tsc --noEmit"},"_npmUser":{"name":"salehsquared","email":"salehmostafamain@gmail.com"},"repository":{"url":"git+https://github.com/salehsquared/agenteer.git","type":"git","directory":"packages/trust"},"_npmVersion":"10.8.2","description":"Agenteer trust layer: evidence records, structured output with retry, filesystem access guard, cross-check engine. Zero dependency on @agenteer/core.","directories":{},"_nodeVersion":"20.17.0","dependencies":{"zod":"^4.3.6","yaml":"^2.8.2"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"vitest":"^3.2.4"},"_npmOperationalInternal":{"tmp":"tmp/trust_1.0.0-rc.1_1776180443837_0.8118211031825029","host":"s3://npm-registry-packages-npm-production"}},"1.0.0-rc.2":{"name":"@agenteer/trust","version":"1.0.0-rc.2","description":"Agenteer trust layer: evidence records, structured output with retry, filesystem access guard, cross-check engine. Zero dependency on @agenteer/core.","keywords":["agenteer","agent","evidence","structured-output","zod","cross-check","llm","trust","observability"],"author":{"name":"salehsquared","url":"https://github.com/salehsquared"},"license":"MIT","homepage":"https://github.com/salehsquared/agenteer#readme","bugs":{"url":"https://github.com/salehsquared/agenteer/issues"},"repository":{"type":"git","url":"git+https://github.com/salehsquared/agenteer.git","directory":"packages/trust"},"type":"module","main":"./dist/index.js","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"./evidence":{"types":"./dist/evidence/index.d.ts","default":"./dist/evidence/index.js"},"./structured":{"types":"./dist/structured/index.d.ts","default":"./dist/structured/index.js"},"./access":{"types":"./dist/access/index.d.ts","default":"./dist/access/index.js"},"./crosscheck":{"types":"./dist/crosscheck/index.d.ts","default":"./dist/crosscheck/index.js"}},"engines":{"node":">=20"},"publishConfig":{"access":"public"},"scripts":{"build":"tsc -b","typecheck":"tsc --noEmit","test":"vitest run"},"dependencies":{"yaml":"^2.8.2","zod":"^4.3.6"},"devDependencies":{"vitest":"^3.2.4"},"_id":"@agenteer/trust@1.0.0-rc.2","gitHead":"ee68c161faabbe38bd1f8c1118b3046dbb06ee55","_nodeVersion":"20.17.0","_npmVersion":"10.8.2","dist":{"integrity":"sha512-tiTgmA8ySpQFa5TP7eZ7PTEpOLdaDQUpN2uZFxZBXIh9pT6Sb4EYJj9QEl+uQViI9LaGU2WkjeH6jzHoZQPf/Q==","shasum":"0006f5615f61693c5631fc9898d9f61d09af5d84","tarball":"https://registry.npmjs.org/@agenteer/trust/-/trust-1.0.0-rc.2.tgz","fileCount":99,"unpackedSize":161834,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIE3ILN2yBTGvy5VF78XPQGGvb6oED5Du6tKgWbj/GAlrAiBRh3cooftli729D/jCiuuTTjZPEPJuw5zK1FlWyU/zgQ=="}]},"_npmUser":{"name":"salehsquared","email":"salehmostafamain@gmail.com"},"directories":{},"maintainers":[{"name":"salehsquared","email":"salehmostafamain@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/trust_1.0.0-rc.2_1776223112872_0.8991506183974534"},"_hasShrinkwrap":false}},"time":{"created":"2026-04-14T15:27:23.763Z","modified":"2026-04-15T03:18:33.173Z","1.0.0-rc.1":"2026-04-14T15:27:24.006Z","1.0.0-rc.2":"2026-04-15T03:18:33.032Z"},"bugs":{"url":"https://github.com/salehsquared/agenteer/issues"},"author":{"name":"salehsquared","url":"https://github.com/salehsquared"},"license":"MIT","homepage":"https://github.com/salehsquared/agenteer#readme","keywords":["agenteer","agent","evidence","structured-output","zod","cross-check","llm","trust","observability"],"repository":{"type":"git","url":"git+https://github.com/salehsquared/agenteer.git","directory":"packages/trust"},"description":"Agenteer trust layer: evidence records, structured output with retry, filesystem access guard, cross-check engine. Zero dependency on @agenteer/core.","maintainers":[{"name":"salehsquared","email":"salehmostafamain@gmail.com"}],"readme":"# @agenteer/trust\n\nTrust layer for [Agenteer](https://github.com/salehsquared/agenteer). Four standalone modules you can use with or without the full runtime:\n\n- **`/evidence`** — `EvidenceRecordSchema`, `YamlEvidenceStore`, and `MemoryEvidenceStore` for append-only evidence records.\n- **`/structured`** — `StructuredProvider`, a native-first structured-output wrapper with text-parse retry fallback.\n- **`/access`** — `DenylistChecker`, `snapshot`, and `diffSnapshots` for filesystem policy and access auditing.\n- **`/crosscheck`** — `CrossCheckEngine` for comparing primary and secondary structured outputs.\n\n**Zero runtime dependency on `@agenteer/core`** — this package stays usable in plain Node projects that want evidence-style observability.\n\n## Install\n\n```bash\nnpm install @agenteer/trust zod\n```\n\nRequires **Node >= 20**.\n\n## Evidence records\n\n```ts\nimport { YamlEvidenceStore, type EvidencePutInput } from \"@agenteer/trust/evidence\";\n\nconst store = new YamlEvidenceStore({\n  dir: \"./.session/evidence\",\n  duplicates: \"dedupe\",\n});\n\nconst record: EvidencePutInput = {\n  evidence_version: 1,\n  claim_refs: [],\n  run: {\n    timestamp: new Date().toISOString(),\n    trigger: \"agent\",\n    node_run_id: \"nrun-123\",\n    lineage_id: \"L-42\",\n  },\n  tool: {\n    name: \"tsc\",\n    command: \"tsc --noEmit\",\n    exit_code: 0,\n  },\n  result: {\n    verdict: \"pass\",\n    summary: \"compile clean\",\n  },\n  kind: \"gate_check\",\n};\n\nawait store.put(record);\n```\n\nThe store writes one YAML file per record, keeps stale markers append-only, and validates every write against `EvidenceRecordSchema`.\n\n## Structured output with retry\n\n```ts\nimport { StructuredProvider, type ProviderLike } from \"@agenteer/trust/structured\";\nimport { z } from \"zod\";\n\nconst provider: ProviderLike = {\n  modelId: \"demo-text-model\",\n  async generate() {\n    return [\n      \"title: Release checklist\",\n      \"bullets:\",\n      \"  - Verify docs\",\n      \"  - Run tests\",\n      \"  - Pack tarballs\",\n    ].join(\"\\n\");\n  },\n};\n\nconst Spec = z.object({\n  title: z.string(),\n  bullets: z.array(z.string()).min(3),\n});\n\nconst structured = new StructuredProvider(provider);\nconst result = await structured.generate({\n  systemPrompt: \"Return a concise checklist.\",\n  userPrompt: \"Summarize the release prep as three bullets.\",\n  schema: Spec,\n  schemaName: \"release_checklist\",\n  maxRetries: 2,\n});\n```\n\nIf the provider exposes native structured output, `StructuredProvider` uses it. Otherwise it falls back to text parsing with validation-aware retries.\n\n## Filesystem access utilities\n\n```ts\nimport { DenylistChecker } from \"@agenteer/trust/access\";\n\nconst checker = new DenylistChecker({ extend: [\"/tmp/secrets\"] });\n\nchecker.assertAllowed(\"/tmp/project/notes.md\");\nconsole.log(checker.isAllowed(\"/etc/passwd\")); // false\n```\n\nUse `snapshot()` and `diffSnapshots()` when you need before/after filesystem evidence for a scoped subtree.\n\n## Cross-check engine\n\n```ts\nimport { CrossCheckEngine } from \"@agenteer/trust/crosscheck\";\nimport { StructuredProvider, type ProviderLike } from \"@agenteer/trust/structured\";\nimport { z } from \"zod\";\n\nconst makeProvider = (modelId: string, yaml: string): ProviderLike => ({\n  modelId,\n  async generate() {\n    return yaml;\n  },\n});\n\nconst engine = new CrossCheckEngine(\n  new StructuredProvider(makeProvider(\"primary-model\", \"max: 3\")),\n  new StructuredProvider(makeProvider(\"secondary-model\", \"max: 3\")),\n);\n\nconst report = await engine.run({\n  systemPrompt: \"Extract the retry budget.\",\n  userPrompt: \"The config says the max retry count is 3.\",\n  schema: z.object({ max: z.number() }),\n  schemaName: \"retry_budget\",\n});\n```\n\nThe outcome tells you whether the two passes agreed, disagreed on specific keys, or skipped because no secondary generator was configured.\n\n## License\n\nMIT — see LICENSE.\n","readmeFilename":"README.md"}