Skip to main content

F.A.I.L. Kit Python Language Server for LangChain, CrewAI, and AutoGen

Project description

F.A.I.L. Kit Python LSP Server

A Language Server Protocol (LSP) implementation for auditing Python AI agent code. Provides real-time diagnostics, code actions, and hover information for LangChain, CrewAI, and AutoGen frameworks.

Features

  • Real-time Diagnostics: Detects missing receipts, unhandled errors, secret exposure, and more
  • Framework Support: LangChain, CrewAI, AutoGen, and generic Python agent patterns
  • Code Actions: Quick fixes for common issues (add try-catch, generate receipts)
  • Hover Information: Contextual documentation for F.A.I.L. Kit rules

Installation

pip install failkit-lsp

Or from source:

cd middleware/python-lsp
pip install -e .

Usage

VS Code

Add to your settings.json:

{
  "failKit.pythonLsp.enabled": true,
  "failKit.pythonLsp.path": "failkit-lsp"
}

Neovim (with nvim-lspconfig)

local lspconfig = require('lspconfig')
local configs = require('lspconfig.configs')

if not configs.failkit_lsp then
  configs.failkit_lsp = {
    default_config = {
      cmd = { 'failkit-lsp' },
      filetypes = { 'python' },
      root_dir = lspconfig.util.root_pattern('pyproject.toml', 'setup.py', '.git'),
    },
  }
end

lspconfig.failkit_lsp.setup{}

Command Line

Run the server directly:

failkit-lsp --stdio

Or with TCP:

failkit-lsp --tcp --host 127.0.0.1 --port 2087

Supported Rules

Rule ID Description Severity
FK001 Missing Receipt for Tool Call Error
FK002 Missing Error Handling Warning
FK003 Secret Exposure Error
FK004 Side-Effect Without Confirmation Warning
FK005 LLM Call Missing Resilience Info
FK006 Missing Provenance Metadata Warning
FK007 Hardcoded Credential Error
FK008 CrewAI Task Missing Error Handler Warning
FK009 AutoGen Agent Missing Termination Warning

Framework-Specific Detection

LangChain

  • AgentExecutor.invoke() / .run() calls
  • BaseTool subclasses without receipt generation
  • @tool decorated functions
  • Chain invocations without error handling

CrewAI

  • Crew.kickoff() calls
  • Task definitions without error handlers
  • Agent configurations missing memory settings

AutoGen

  • UserProxyAgent / AssistantAgent configurations
  • initiate_chat() calls without termination conditions
  • Function tool definitions

Configuration

Create a .failkit.yaml or failkit.config.json in your project root:

# .failkit.yaml
python:
  enabled: true
  severity_overrides:
    FK005: "warning"  # Downgrade resilience checks to warnings
  ignore_patterns:
    - "**/tests/**"
    - "**/migrations/**"
  frameworks:
    langchain: true
    crewai: true
    autogen: true

Development

# Install dev dependencies
pip install -e ".[dev]"

# Run tests
pytest

# Format code
black src tests
ruff check src tests

# Type check
mypy src

License

MIT License - see LICENSE file for details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

fail_kit-1.1.0.tar.gz (24.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

fail_kit-1.1.0-py3-none-any.whl (29.1 kB view details)

Uploaded Python 3

File details

Details for the file fail_kit-1.1.0.tar.gz.

File metadata

  • Download URL: fail_kit-1.1.0.tar.gz
  • Upload date:
  • Size: 24.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for fail_kit-1.1.0.tar.gz
Algorithm Hash digest
SHA256 732e13892e1901365114552616d75ce2e1cb0d4080dd36d025d7a6f85a1cca35
MD5 ec72b8feaf2331e663679c34d2bc6182
BLAKE2b-256 9b615ada2035cec7fbe5a9fc8821dc6c8944188b5c1398982e3e7b9c2f8633fe

See more details on using hashes here.

File details

Details for the file fail_kit-1.1.0-py3-none-any.whl.

File metadata

  • Download URL: fail_kit-1.1.0-py3-none-any.whl
  • Upload date:
  • Size: 29.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for fail_kit-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5809ddf47df684faede529c011d57ad688c37ff62d6a480406664d8a7b02bba5
MD5 270b5a1a4989ade11039cb8b72483aaa
BLAKE2b-256 3513a580276172b9b15e7f17af1aee01d7d122b5735816fe4f5b70641feada4c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page