Internal AI Platform Architecture: Connect Agents to Your Stack
A practitioner’s guide to architecting an internal AI platform that safely connects Slack agents to GitHub, Jira, Linear, Notion, Snowflake, and more—with approvals, evals, and cost controls.
You have strong teams using GitHub, Jira or Linear, Notion, Slack, and a warehouse like Snowflake. Point solutions are tapped out. You want an internal system where assistants can triage, search, summarize, and take action—without breaking access controls or blowing up spend. This guide shows the concrete architecture we deploy: a connector layer, per-team scoping, approvals for write actions, eval harnesses, observability, and cost controls. We cover build-vs-buy and the security review you must pass. If you have the people, you can implement this yourself. If not, we build it with you.
What an AI platform inside your stack must actually do
Think in components, not buzzwords. The platform is a thin control plane over a set of services you already run. Core flow: Slack (or another interface) → router → policy engine → connectors → tools → back to the user. Agentic behavior lives in the router and tools, not in a single model call.
Connector layer: ship first-class integrations for Slack, GitHub, Jira, Linear, Notion, and Snowflake. Make them stateless, idempotent, and scoped per team. Each connector exposes read and safe-write methods with typed inputs and outputs. Example config:
# connectors.yaml
slack:
scopes: ["channels:history", "chat:write"]
github:
scopes: ["repo", "workflow"]
jira:
scopes: ["read:jira-work", "write:jira-work"]
linear:
scopes: ["read", "write"]
notion:
scopes: ["databases:read", "databases:write"]
snowflake:
role: ANALYTICS_READONLY
warehouse: XSMALL
database: PROD
schema: ANALYTICS
Architecture in words: inbound messages hit a gateway, are enriched with identity, then routed to an agent that selects tools. Tools call connectors using short-lived tokens minted by a broker. A policy engine checks access and approval requirements before any write. Events stream to logs for audits and a metrics store for a dashboard. Caches (Redis) hold retrieval artifacts. Model calls (OpenAI, Anthropic, Azure OpenAI, or self-hosted) sit behind a cost guard.
If you want a pre-scoped path to Slack-first assistants, see our Slack AI Agents service and the deeper implementation notes in Building a Slack AI Agent That Can Actually Query Your Warehouse.
Identity, scopes, permissions, and approvals that survive audit
Identity must anchor everything. Map Slack user IDs to your IdP (Okta/AAD) subject, then to service identities for GitHub, Jira/Linear, Notion, and Snowflake. Avoid bot-wide tokens; mint per-user or per-team tokens with clear scopes. Enforce access controls at the connector boundary and at the tool layer.
Scoping patterns that work:
- Per-team namespaces: marketing, data, finance each get their own secret set, Snowflake role, and default Slack channels.
- Least privilege roles: e.g., Snowflake ANALYTICS_READONLY for exploration, task-specific roles for writes.
- Row-level and project scoping: in Jira/Linear, restrict projects by team; in Notion, restrict databases to specific groups.
Write actions require explicit approval. Encode policy as code, not in UI toggles. Example:
# approvals.yaml
policies:
- id: "linear.create_issue"
when:
team: ["marketing", "data"]
channels: ["#growth-ops", "#data-requests"]
require:
approvals: 1
approvers:
group: "leads"
timeout_minutes: 30
- id: "snowflake.run_update"
when:
role: "ANALYTICS_WRITER"
require:
change_ticket: true
approvals: 2
In Slack, the assistant posts a proposed action with a diff-like summary and buttons. Approvals generate signed tokens valid only for the approved call. Log the request, prompt, tool inputs, approver, and result hash. For BI changes, tie approval to a dbt tag and produce an exposure so lineage shows who approved what.
Skip any of this and week two you will discover the bot can post to private repos, or a data analyst can accidentally re-open 500 Jira issues. Defense is in the defaults.
Data layer, retrieval, evals, and agent behavior
Agentic systems depend on reliable retrieval and deterministic tools, not just a clever prompt. Keep three layers:
- Retrieval: indexes over docs (Notion, GitHub READMEs), structured data (Snowflake), and tickets (Jira/Linear). Use Redis or a vector store for chunks; keep keys aligned to permissions.
- Tools: deterministic functions like "+list_open_prs", "+create_linear_issue", "+query_snowflake" with strict schemas. Validate inputs.
- Router: picks tools, manages loops, and halts on policy violations.
For warehouse queries, define safe views and timeboxed warehouses. Example Snowflake view and guardrail:
-- snowflake.sql
create or replace view ANALYTICS.SAFE.orders_public as
select id, customer_id, order_ts::date as order_date, total
from RAW.orders
where order_ts >= dateadd(month, -24, current_date);
Build an eval harness that runs prompts and tool sequences on seeded fixtures. Use a labeled set of tasks per team (marketing summaries, data triage, engineering ticket grooming). Track exact token usage and tool outcomes. Example harness sketch:
# eval_harness.py
import time
from platform import run_task
def run_suite(tasks):
results = []
for t in tasks:
start = time.time()
out = run_task(t)
results.append({
"task": t["id"],
"ok": out.success,
"tokens": out.tokens,
"tools": out.tools_used,
"latency_ms": int((time.time()-start)*1000)
})
return results
Score for correctness (exact match or regex), safety (no forbidden tools), and cost. Evals catch the second-week failures: tools called with partial context, prompts leaking secrets, or the assistant looping on a flaky API. Keep the ai model choice injectable so you can swap providers without rewriting tools. This is where real ai capabilities show up: consistent retrieval, safe automation, and measured behavior, not a single benchmark.
The Slack interface: assistants that actually do work
Slack is where most teams live. Treat it as your primary conversational ai surface and control plane. Patterns that hold up:
- One workspace app with per-team feature flags.
- Thread-first design to avoid channel noise and to preserve context.
- Action previews for any write, with approvals in-thread.
- Short-lived links for dashboards or BI drill-throughs.
Minimal agent loop (omitting retries/telemetry):
# slack_agent.py
from tools import list_prs, query_snowflake, create_linear
def handle_message(user, channel, text):
intent = classify(text)
if intent == "prs":
return list_prs(user)
if intent == "kpi":
sql = "select count(*) from ANALYTICS.SAFE.orders_public where order_date >= current_date - 7"
return query_snowflake(user, sql)
if intent.startswith("create_issue:"):
title, body = parse_issue(text)
return create_linear(user, title, body, require_approval=True)
If your team wants end-to-end instructions and code that runs real queries, we covered warehouse querying, RLS, and tool schemas here: Building a Slack AI Agent That Can Actually Query Your Warehouse. For productionizing assistants for multiple teams, our Slack AI Agents offering adds approvals, cost guards, and observability. This approach beats generic chatbots because it wires concrete tools into your systems, improving operational efficiency and productivity without new tabs.
Observability and cost controls that keep you safe
Every model call and tool invocation must emit events. Capture: user, team, prompt template version, ai model, tokens in/out, tools called, approvals, cost estimate, latency, and final status. Stream to a warehouse and to a live dashboard.
Snowflake cost guard example (measure on your own system):
-- credits_by_team.sql
select
date_trunc('day', start_time) as day,
team,
sum(credits_used_cloud_services + credits_used_compute) as credits
from PLATFORM_BILLING.QUERY_HISTORY
where start_time >= dateadd(day, -14, current_timestamp())
group by 1,2
order by 1 desc;
Cache expensive retrieval with Redis and timebox:
# cache.py
import redis, json, time
r = redis.Redis()
def get_or_set(key, fn, ttl=300):
v = r.get(key)
if v: return json.loads(v)
out = fn()
r.setex(key, ttl, json.dumps(out))
return out
Guardrails that matter:
- Per-team monthly token and credit budgets; hard stop plus Slack alerts at 80%.
- Warehouse query timeouts and warehouse downscale on idle.
- Tool-specific rate limits (e.g., Linear issue creation max 10/day/team).
- Eval-gated deployments: fail deployment if eval deltas regress beyond thresholds.
Reality check: a 40M-row orders table on an X-Small warehouse will be slow if your assistant runs ad hoc count-distincts across joins. Pre-aggregate in dbt, expose safe views, and teach the agent to hit those instead. Observability won’t fix a bad model, but it will show you exactly where to tune.
Build vs buy—and the security review you must pass
Be honest about your constraints. You can build internal, but the hidden work is identity, scoping, approvals, and observability. Buying saves time but can box you into an interface or access pattern that doesn’t match your org. Use this comparison:
| Criteria | Build | Buy |
|---|---|---|
| Integration depth | Deep, custom ai tools and policies | Shallow to medium; vendor roadmap gates |
| Time to first value | Weeks if focused | Days |
| Ongoing maintenance | Your SRE/DE time | Vendor SLAs |
| Data security posture | Matches your standards | Depends on vendor |
| Cost control | Granular | Per-seat or per-call |
Security review checklist:
- Data flow diagram: prompts, tools, storage, logs. Include where ai technology runs (cloud vs on-prem).
- PII handling: masking at retrieval, secrets redaction, and prompt filters.
- Access controls: least-privilege roles, token lifecycle, break-glass policy.
- Vendor posture: SOC2/ISO, region control (Azure, GCP, or AWS), model privacy modes.
- Audit logging: immutability, retention, and query access for compliance.
- AI governance: approvals, evals, rollback, and human-in-the-loop thresholds.
If you want our hardening patterns and reference implementations, see Internal AI Platforms. Whether you build custom or buy, expect to demo to security with real flows and logs, not slides. That is how enterprise ai gets unblocked.
Deployment and infrastructure that won’t page you
Keep it boring. Run the control plane as a small set of services: gateway, router, tools, connectors. Use containers and your standard CI/CD. Vercel can host stateless frontends and thin APIs; for long-running jobs, add a worker queue (Celery, Sidekiq) and a scheduler (Airflow). Yes, you can run ai agents on Vercel for short-lived requests; move heavy work to workers.
Reference stack notes:
- PostgreSQL for platform metadata; Redis for caches and rate limits; MongoDB only if you truly need schemaless payloads.
- Snowflake for analytics; dbt for pre-aggregation and contracts; BI of your choice for a usage dashboard.
- GitHub Actions for CI; IaC via Terraform.
- Model providers: OpenAI, Anthropic, Google, or Azure OpenAI—keep a provider adapter.
Example Airflow DAG to refresh safe aggregates used by the assistant:
# dags/ai_aggregates.py
from airflow import DAG
from airflow.providers.snowflake.operators.snowflake import SnowflakeOperator
from datetime import datetime
dag = DAG("ai_aggregates", start_date=datetime(2024,1,1), schedule="0 * * * *", catchup=False)
SnowflakeOperator(
task_id="refresh_orders_7d",
sql="call ANALYTICS.MART.refresh_orders_7d();",
dag=dag,
)
Agentic patterns: keep the loop shallow (plan → act → reflect). Hard-stop loops at N steps. Log tool traces. Agentic ai is powerful, but supervision and observability prevent runaway costs. If your IDP evolves to support ai coding agents, ensure it provisions secrets, approvals, and ephemeral sandboxes the same way it does for services today.
FAQ: straight answers to what teams ask
What are the 5 main AI platforms?
Representative choices: OpenAI, Anthropic, Google AI Studio, AWS Bedrock, and IBM watsonx. Pick based on privacy modes, latency, and pricing in your region.
What is an internal AI system?
A governed set of services that let assistants use ai to read and write across your stack with policy, approvals, and observability. It’s not one model; it’s identity, tools, and automation glued together.
What is a $900000 AI job?
Exceptionally high-comp roles occasionally advertised for niche expertise. Don’t plan your program around headlines. Staff for platform, data, and security fundamentals.
What is Amazon’s internal AI?
Amazon publicly offers Bedrock and internal services; specifics of their internal deployments aren’t public. Don’t cargo-cult—design for your org’s constraints.
Can you run AI agents on Vercel?
Yes for stateless/short tasks. Use background workers for long-running actions and Webhooks for callbacks.
Do AI coding agents change what an IDP needs to do?
Yes. Your platform should provision ephemeral envs, scoped tokens, and approval gates for code changes the same way it does for services.
Do internal AI tools require a large engineering team to maintain?
No, if you keep the surface small and reuse your stack. One pragmatic team can run it if you standardize connectors, approvals, and logging.
How are vibe coding tools different from AI autocomplete tools?
Autocomplete predicts the next tokens inline; vibe tools attempt higher-level planning and execution across repos—more agentic, more risk, more policy needed.
How can enterprises measure ROI from conversational AI platforms?
Track tickets closed without humans, time-to-first-answer, approvals per write action, and credit/token spend per resolved request. Compare to baseline week-by-week.
How do enterprises ensure data security when deploying conversational AI?
Least privilege, per-user tokens, prompt redaction, immutable audits, and eval-gated releases. Treat assistants like production apps.
How long does it take to build an internal AI tool?
Depends on connectors, approvals, and eval breadth. Estimate by counting integrations, number of write actions needing policy, and eval tasks per team.
How will conversational and agentic AI evolve next?
Better tool use, safer planning, and tighter integration with BI and workflows. Expect stronger guardrails and cheaper inference, not magic.
ROI, governance, and adoption without drama
Define a narrow use case per team: marketing summaries, data triage, or on-call ticket prep. Ship assistants with clear commands and a visible audit trail. Your conversational ai platform should land with two things ready: a dashboard that shows usage, approvals, spend, and outcomes; and an eval harness to prevent regressions.
Governance in practice:
- Policy as code reviewed like any PR.
- Change management via approvals and rollback plans for prompts and tools.
- Quarterly risk reviews on data security and vendor posture.
This isn’t about chasing the best ai. It’s about reliable ai applications that integrate with your tools and processes to automate real work. If you want patterns we’ve battle-tested at scale—dbt and warehouse setups, Airflow hooks, and Slack-native interfaces—browse our AI agents articles or talk to us about Internal AI Platforms. We can help you build internal safely, or deploy internal fast, without losing control.
Next step: pick one team, one assistant, and one write action—then ship. If you want a partner, start a project with Vertex.
About the author
Eric Provencio — Analytics engineer who has built and run production data platforms for Disney, Hulu, Nike, Peloton, Gopuff, and Kaplan. Founded Vertex Data Consulting to do the deep work most data teams never find time for: dbt Cloud migrations, repo performance, Airflow reliability, and AI agents that actually touch the stack.