# AI Trust & Accountability Dashboard

## PURPOSE
Barracuda's CIO gives three concrete signals she watches: weekly agent accuracy ("every week that goes by, we're measuring them"), the human share of accountability ("AI will never be accountable. I will be accountable"), and shadow-AI pressure ("something that concerns me every day"). This Streamlit + Plotly dashboard puts all three on one screen so a leader can see, at a glance, whether the organisation's AI fleet is still trustworthy.

## WHY THIS MATTERS
The transcript's argument is that accountability is a non-negotiable trade-off, not a slogan — but trade-offs you cannot see are trade-offs you cannot manage. The dashboard turns qualitative trust statements into three measurable panels, an honest mirror of the "people powered, AI enhanced" posture Barracuda describes.

## HOW TO BUILD
Use Streamlit for the app shell and Plotly for interactive charts, reading two CSVs: `agent_metrics.csv` (`agent_id, week, accuracy`) and `decisions.csv` (`week, ai_answers, human_approved, shadow_flagged`).
- Panel 1 — line chart of accuracy per agent across weeks, with a baseline reference line.
- Panel 2 — stacked bar of approved vs unapproved answers (the accountability coverage ratio).
- Panel 3 — gauge/bar of shadow-AI flags per week with a threshold alert.

```python
import streamlit as st, pandas as pd, plotly.express as px

st.set_page_config(page_title="AI Trust & Accountability", layout="wide")
metrics = pd.read_csv("agent_metrics.csv")

st.subheader("Agent accuracy vs launch baseline")
fig = px.line(metrics, x="week", y="accuracy", color="agent_id", markers=True)
fig.add_hline(y=metrics.groupby("agent_id")["accuracy"].first().mean(),
              line_dash="dash", annotation_text="baseline")
st.plotly_chart(fig, use_container_width=True)

drifters = metrics.groupby("agent_id").apply(
    lambda g: g.sort_values("week").iloc[-1]["accuracy"] - g.sort_values("week").iloc[0]["accuracy"])
st.metric("Agents drifting", int((drifters < -0.05).sum()), delta=f"{drifters.min():+.3f} worst")
```

## WHEN TO USE IN PRODUCTION
Deploy it as a weekly executive or governance-board view, or embed it in an AI operations review where someone must state whether each agent still meets its launch bar. Excellent for enabling "people provide the answer" — the dashboard forces a named owner per drifting agent. Do **not** use it for live incident response (weekly cadence, not real-time), for per-user behavioural surveillance, or as a substitute for the underlying evaluation harness; the dashboard reports drift, it does not diagnose cause. Avoid it if no one owns follow-up, since an unowned red number becomes wallpaper.

## HOW IT HELPS STUDENTS
Students learn Streamlit layout and state, Plotly chart construction, Pandas groupby/diff analytics, and how to design a dashboard around decisions rather than decoration. They finish able to translate a governance narrative into an executive-ready visual.

## STARTER CODE
`starter/main.py` loads the CSVs, renders all three panels with Plotly, and computes drift metrics, with `# TODO` markers for filters, alerting, and owner assignment.
