{"_id":"@aegis-kernel/langchain","_rev":"3-7bf67be416d8d909b6dcb813f3b345cd","name":"@aegis-kernel/langchain","dist-tags":{"latest":"1.1.0"},"versions":{"1.0.0":{"name":"@aegis-kernel/langchain","version":"1.0.0","keywords":["langchain","langgraph","ai-agents","guardrails","tool-guard","invariants"],"author":{"name":"Sneh Gabani","email":"sneh@aegis-kernel.dev"},"license":"MIT","_id":"@aegis-kernel/langchain@1.0.0","maintainers":[{"name":"aegis-kernel","email":"sneh.gabani1999@gmail.com"}],"homepage":"https://aegis-kernel.dev","bugs":{"url":"https://github.com/Snehgabani/aegis-kernel/issues"},"dist":{"shasum":"0ff2b0881cfcc2560bc07552ff419d0fd9b74ae9","tarball":"https://registry.npmjs.org/@aegis-kernel/langchain/-/langchain-1.0.0.tgz","fileCount":8,"integrity":"sha512-Gm5xibGZ0u+Z+iRHQJbmLvHW8xWt/ZJPg+m3mVdsihjYWy9FgCy4bzDnh+9J9FpV+bAW+7e1ExiGxZeetRuQAg==","signatures":[{"sig":"MEQCIEssSCxNaI3fKlY2rGNX5JUGUKyqTvBNj9dcJFNyIZIdAiBbfLAcL+L3zZDRGCeiaF+7Xbz2b2dp5Zw2AgGXUM+qLA==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":16948},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","engines":{"node":">=18.0.0"},"exports":{".":{"types":{"import":"./dist/index.d.ts","require":"./dist/index.d.cts"},"import":"./dist/index.js","require":"./dist/index.cjs"}},"gitHead":"a5d907eb2f205ff5d5a96abcf5da33d1b900eaff","scripts":{"lint":"tsc --noEmit","test":"vitest run","build":"tsup"},"_npmUser":{"name":"aegis-kernel","email":"sneh.gabani1999@gmail.com"},"repository":{"url":"git+https://github.com/Snehgabani/aegis-kernel.git","type":"git","directory":"packages/langchain"},"_npmVersion":"10.9.8","description":"LangChain and LangGraph deterministic invariant tool guard","directories":{},"_nodeVersion":"22.23.2","dependencies":{"@aegis-kernel/core":"*"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.3.6","vitest":"^4.1.10","typescript":"^5.7.3","@types/node":"^26.2.0"},"_npmOperationalInternal":{"tmp":"tmp/langchain_1.0.0_1787148113999_0.16766484379208624","host":"s3://npm-registry-packages-npm-production"},"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."},"1.1.0":{"name":"@aegis-kernel/langchain","version":"1.1.0","keywords":["langchain","langgraph","ai-agents","guardrails","tool-guard","invariants"],"author":{"name":"Sneh Gabani","email":"sneh@aegis-kernel.dev"},"license":"MIT","_id":"@aegis-kernel/langchain@1.1.0","maintainers":[{"name":"aegis-kernel","email":"sneh.gabani1999@gmail.com"}],"homepage":"https://snehgabani.github.io/aegis-kernel/","bugs":{"url":"https://github.com/Snehgabani/aegis-kernel/issues"},"dist":{"shasum":"471c2e9cefefac6c2b906ec19da57e7a1774487a","tarball":"https://registry.npmjs.org/@aegis-kernel/langchain/-/langchain-1.1.0.tgz","fileCount":8,"integrity":"sha512-/AuiJQEim5wwXblgDMXya/Trl5EfHSTlwLupuih6bjmytTxcTVRFSRojIPl2ykgkzOvaMmdf2SgmX+s4KWdElg==","signatures":[{"sig":"MEYCIQDmCQgbAouj/0E2L2R6thJr712PlB2/RztfR44VIJ0svwIhAP1Kz99gmerHe+WhAj7n08bRM2u+xoDqs34V38jeRepc","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@aegis-kernel%2flangchain@1.1.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":16974},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","engines":{"node":">=18.0.0"},"exports":{".":{"types":{"import":"./dist/index.d.ts","require":"./dist/index.d.cts"},"import":"./dist/index.js","require":"./dist/index.cjs"}},"gitHead":"6d41f24ec5a43c311fef98c4d2bb6f4962974295","scripts":{"lint":"tsc --noEmit","test":"vitest run","build":"tsup"},"_npmUser":{"name":"aegis-kernel","email":"sneh.gabani1999@gmail.com"},"repository":{"url":"git+https://github.com/Snehgabani/aegis-kernel.git","type":"git","directory":"packages/langchain"},"_npmVersion":"10.8.2","description":"LangChain and LangGraph deterministic invariant tool guard","directories":{},"_nodeVersion":"20.20.2","dependencies":{"@aegis-kernel/core":"*"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.3.6","vitest":"^4.1.10","typescript":"^5.7.3","@types/node":"^26.2.0"},"_npmOperationalInternal":{"tmp":"tmp/langchain_1.1.0_1787306477042_0.0372684936155292","host":"s3://npm-registry-packages-npm-production"},"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."}},"time":{"created":"2026-08-19T14:01:53.641Z","modified":"2026-08-30T02:35:34.547Z","1.0.0":"2026-08-19T14:01:54.208Z","1.1.0":"2026-08-21T10:01:17.177Z"},"bugs":{"url":"https://github.com/Snehgabani/aegis-kernel/issues"},"author":{"name":"Sneh Gabani","email":"sneh@aegis-kernel.dev"},"license":"MIT","homepage":"https://snehgabani.github.io/aegis-kernel/","keywords":["langchain","langgraph","ai-agents","guardrails","tool-guard","invariants"],"repository":{"url":"git+https://github.com/Snehgabani/aegis-kernel.git","type":"git","directory":"packages/langchain"},"description":"LangChain and LangGraph deterministic invariant tool guard","maintainers":[{"name":"aegis-kernel","email":"sneh.gabani1999@gmail.com"}],"readme":"# 🛡️ @aegis-kernel/langchain\n\n> **LangChain & LangGraph Deterministic Tool Safety Guard**  \n> *Sub-Millisecond Invariant Clearance • Automatic Error Feedback • Safe Tool Proxying*\n\n[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)\n[![TypeScript](https://img.shields.io/badge/TypeScript-5.7-blue.svg)](https://www.typescriptlang.org/)\n[![Node.js](https://img.shields.io/badge/Node.js-%3E%3D18.0-green.svg)](https://nodejs.org/)\n\n---\n\n## 🚀 Overview\n\n`@aegis-kernel/langchain` wraps LangChain and LangGraph `DynamicStructuredTool` and `StructuredTool` instances with transparent, deterministic invariant clearance. If an agent attempts an unsafe action (e.g. unconstrained database deletion, parameter overflow), the guard halts execution and returns a structured invariant violation error.\n\n---\n\n## 📦 Installation\n\n```bash\nnpm install @aegis-kernel/langchain @aegis-kernel/core\n```\n\n---\n\n## ⚡ Quickstart\n\n```typescript\nimport { DynamicStructuredTool } from '@langchain/core/tools';\nimport { AegisLangChainGuard } from '@aegis-kernel/langchain';\nimport { z } from 'zod';\n\n// 1. Define your LangChain tools\nconst databaseTool = new DynamicStructuredTool({\n  name: 'database_exec',\n  description: 'Executes a SQL query against the database',\n  schema: z.object({\n    query: z.string().describe('The SQL query to execute'),\n  }),\n  func: async ({ query }) => {\n    return await db.raw(query);\n  },\n});\n\n// 2. Wrap tools with Aegis Invariant Guard\nconst guard = new AegisLangChainGuard({\n  mode: 'enforce',\n  packs: ['@aegis/sql-guard', '@aegis/data-guard'],\n});\n\nconst safeTool = guard.wrap(databaseTool);\n// Or wrap all agent tools in one call:\n// const safeTools = guard.wrapAll([tool1, tool2, tool3]);\n\n// 3. Pass safeTool to your LangChain AgentExecutor or LangGraph workflow\n```\n\n---\n\n## 📄 License\n\nDistributed under the [MIT License](https://opensource.org/licenses/MIT). Copyright (c) 2026 Sneh Gabani.\n","readmeFilename":"README.md"}