Guard Dog developer samples

These selected integration samples accompany the Vatrion Getting started page:
https://vatrion-corporate.eionai.chatgpt.site/resources

Start here
1. Install your supplied Guard Dog wheel in a Python 3.11+ virtual environment.
   Installation commands:
   https://vatrion-corporate.eionai.chatgpt.site/documentation#installation
2. Extract this archive and open a terminal in the extracted folder.
3. Use the same Python environment for installation and the sample commands.

First local examples (no provider account needed)
  python samples/integrations/custom_scan.py
  python samples/integrations/batch_scan.py
  python samples/integrations/agent_tool_boundaries.py
  python samples/integrations/pii_pipeline.py
  python samples/integrations/streaming_egress.py
  python samples/integrations/guarddog_class.py

custom_scan.py modes
  python samples/integrations/custom_scan.py governance
  python samples/integrations/custom_scan.py session
  python samples/integrations/custom_scan.py breeds

The GuardDog class sample resets its process singleton to compare modes in one
educational run. In application code, initialize the scanner for your policy.
The LEARN demonstration uses a temporary JSONL file and removes it afterward.

ASGI middleware examples
  python -m pip install starlette httpx uvicorn
  python samples/integrations/asgi_egress_enforcement.py
  python samples/integrations/custom_scan.py field_targets
  python samples/integrations/custom_scan.py middleware

The ASGI egress sample uses an offline backend and synthetic fixture text.
The middleware mode starts a local listener at 127.0.0.1:8099 by default.

MCP stdio client
Install your approved core wheel with the mcp extra, as described at:
https://vatrion-corporate.eionai.chatgpt.site/documentation#mcp
Set GUARD_DOG_EVENT_PUBLISH_MODE=disabled for a local scan-only exercise, then:
  python samples/integrations/mcp_client.py
The client discovers tools and prints the actual returned result metadata.
GUARD_DOG_MCP_COMMAND can select an installed server executable; otherwise the
sample uses the current Python interpreter to run the packaged mcp_server.

Provider integrations
Install only the SDK dependencies you need:
  OpenAI:          python -m pip install openai
  Anthropic:       python -m pip install anthropic
  OpenRouter:      python -m pip install httpx
  Hugging Face:    python -m pip install huggingface_hub httpx
  LangChain:       python -m pip install langchain-openai langchain-core
  LiteLLM:         python -m pip install litellm
All optional sample dependencies are listed in:
  samples/requirements-integrations.txt
Each provider file lists its environment variables. Set a model identifier
available to your account and supply credentials through your environment.
Provider examples send requests when you run them. They are not offline tests.

Local teaching gateway
  python -m pip install fastapi uvicorn httpx
Load the values in samples/config/proxy.env.example into the process environment.
That file is a template; the Python program does not automatically load .env.
Configure the upstream provider and its credential, then run:
  python samples/proxy/gateway_multi_provider.py
Point the provider SDK sample at GUARD_DOG_PROXY=http://127.0.0.1:8090.
This teaching gateway scans inbound requests, rejects streaming, and does not
scan output or authenticate callers. Keep it on loopback for local development.
For authenticated input/output governance and buffered streaming, use the
packaged gateway guide:
https://vatrion-corporate.eionai.chatgpt.site/documentation#gateway-proxy

Results and version compatibility
Sample output reflects the installed library and selected policy. Inspect the
actual findings and response rather than assuming a fixed score or verdict.
The Guard Dog library is installed separately; it is not contained in this ZIP.
Source paths and blob identities are recorded in source-manifest.json.
Installation wording was adapted for this standalone bundle; sample logic is
retained from the library samples directory.
