How vikhayatrana0110-crypto/bastion--a-secure-ai-assistant works
Bastion is an early-stage secure internal knowledge assistant. Its current runtime provides database security checks, authentication primitives, and document-ingestion utilities; it does not yet expose the documented ask-to-cited-answer workflow. The graph separates implemented components from planned retrieval and guardrail capabilities. Source excerpts show startup checks, database access, authentication, and markdown chunking; other documented connections are marked as planned or omitted where implementation evidence is unavailable.
Main entry points: pool.py Connection Pool · login.py Authentication · main.py FastAPI App · tokens.py JWT Tokens
Components 19
Application Runtime
- FastAPI App
src/bastion/main.py - Settings
src/bastion/config.py
Identity and Access
- Authentication
src/bastion/auth/login.py - Password Hashing
src/bastion/auth/passwords.py - JWT Tokens
src/bastion/auth/tokens.py - Access Context
src/bastion/db/access.py
Database Security
- Connection Pool
src/bastion/db/pool.py - Postgres
migrations - Security Checks
src/bastion/db/selfcheck.py - RLS Schema
migrations
Document Ingestion
- Document Validation
src/bastion/ingestion/validate.py - Markdown Parser
src/bastion/ingestion/markdown.py - Token Counting
src/bastion/ingestion/tokenizer.py - Chunking
src/bastion/ingestion/chunking.py
Other components
- Employee
- Hybrid Retrieval (planned)
- Answer Guardrails (planned)
- Cited Answer (planned)
- Leak Evaluation (planned)
Connections 15
- FastAPI App → Connection Pool: opens connection
src/bastion/main.py - FastAPI App → Security Checks: checks invariants
src/bastion/main.py - Connection Pool → Settings: loads connection URL
src/bastion/db/pool.py - Authentication → Password Hashing: verifies passwords
src/bastion/auth/login.py - Authentication → JWT Tokens: reads tokens
src/bastion/auth/login.py - Authentication → Connection Pool: queries identity
src/bastion/auth/login.py - JWT Tokens → Settings: loads signing secret
src/bastion/auth/tokens.py - Access Context → Connection Pool: opens access transaction
src/bastion/db/access.py - Security Checks → Postgres: checks privileges
src/bastion/db/selfcheck.py - RLS Schema → Postgres: defines policies
README.md - Chunking → Markdown Parser: chunks parsed blocks
src/bastion/ingestion/chunking.py - Employee → Hybrid Retrieval (planned): asks about documents
README.md - Hybrid Retrieval (planned) → Cited Answer (planned): returns cited answers
README.md - Answer Guardrails (planned) → Cited Answer (planned): checks grounding
README.md - Leak Evaluation (planned) → RLS Schema: tests access leaks
README.md