Skip to main content

Transparent teaching helpers for the SEAS-8414 phase 9/10 security-analytics notebooks: short cells, visible decisions.

Project description

seas8414-teach

A transparent teaching toolkit for the SEAS-8414 security-analytics course. Move the plumbing into an import so class time goes to analytics, visualization, interpretation, and action — not typing boilerplate.

PyPI Python License: MIT


What it is

seas8414-teach is a small, transparent Python library for teaching security analytics from Jupyter notebooks. It gives an instructor short, readable cells: the library owns the parts nobody teaches live — provenance-checked data loading, a house figure style, a fail-closed language-model grounding contract, resampling/uncertainty loops, and completion-receipt assembly — so each cell keeps only the part that is the lesson: the scoring rule, the model choice, the decision, and the fairness check.

Everything the library hides returns an inspectable object.provenance, .receipt, .controls, .why() — so nothing becomes a black box. You can always open the hood when a student asks; you just don't have to retype it to make a point.

Why it exists (the intention)

Course notebooks accumulate a lot of infrastructure: a download/verify/cache routine, dozens of lines of plot styling, a language-model safety contract, bootstrap loops, and receipts. Typing that in front of a class costs exactly the minutes you want for teaching. This toolkit removes it while keeping the analysis honest and the decisions on screen.

Three properties make it safe to teach from:

  • Reproducible. Loaders read SHA-256-pinned public data and return a provenance record; the same seed gives the same result.
  • Fail-closed by design. In ground(...), the language model may only select an evidence id, an exact field, and a bounded action — it can never author accepted prose. Adversarial inputs are rejected, and any model failure falls back to a validated deterministic template.
  • Fair, not rigged. decide_by_argmax never hard-codes a winner (it is the argmax of the reported utilities); proxy_independence guards against evaluating a method against an outcome it effectively authored.

Install

pip install seas8414-teach            # core (offline-capable; deterministic-fallback grounding)
pip install "seas8414-teach[llm]"     # + the optional local model for the grounding demo

Python 3.11+. Core dependencies: numpy, pandas, scikit-learn, scipy, matplotlib, networkx.

The library

import seas8414_teach as st
st.setup()          # seed (8414) + house figure style
Module What it gives you
st.provenance Data loaders that hide download / SHA-verify / cache and return tidy data + a Provenance record (.sha256, .source, .bytes). Offline-first.
st.methods Thin scikit-learn wrappers with the knobs kept explicit: iforest_rarity, markov_surprise, kmeans_select, nmf_topics, …
st.decide The honest-decision layer: decide_by_argmax → a Decision (.winner, .utilities, .why(), .budget_curve(), .receipt); proxy_independence; paired_bootstrap_gate.
st.grounding ground(prompt, records, fallback) → a Grounded (.accepted, .mode, .controls, .model_authored — always False, .receipt).
st.figures House-style plots: pipeline, event_funnel, budget_curve, scatter, use_house_style.
st.receipt JSON-safe completion receipts for the end of a project.

A teaching cell, before and after

# Instead of ~40 lines of loading + sklearn wiring + plotting + a decision loop:
data   = st.load_cowrie()                                   # provenance hidden; inspect .provenance
scores = st.iforest_rarity(data.sessions, FEATURES)         # sklearn wiring hidden, knobs visible
d      = st.decide_by_argmax(data.sessions, proxy="pivot_escalation_outcome",
                             queues={"baseline": "baseline", "advanced": "advanced"})
d.why()            # a computed, honest sentence about which method wins and why
d.budget_curve()   # a styled, presentation-ready figure

Course coverage

The toolkit is built to grow with the course. Version 0.1.x covers the phase 9/10 projects (supply-chain integrity and active deception): exploited-vulnerability triage, SBOM dependency blast radius, repository-posture archetypes, intrusion detection under shift, honeypot session profiling, and ATT&CK-informed deception coverage. Per-project loaders and notebook-specific methods live under seas8414_teach.projects. The core (provenance, methods, decide, grounding, figures, receipt) is general and is the foundation for additional course phases.

Faithfulness

The teach-edition notebooks that use this toolkit reproduce the gate-verified transparent notebooks exactly — a consistency check asserts every load-bearing decision agrees. The short form is a faithful re-expression of the full analysis, not a separate simplified one.

Safety & scope

These are classroom analyses, not production detectors. The library performs no active scanning, deployment, command execution, network contact, or attribution. The language model never creates labels, edges, flags, metrics, or decisions.

Development

git clone git@github.com:gwuml/seas8414_teach.git && cd seas8414_teach
pip install -e ".[dev]"
pytest -q            # self-contained unit suite (no network / no data cache required)

License

MIT © George Washington University — SEAS-8414. See LICENSE.

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

seas8414_teach-0.1.1.tar.gz (36.4 kB view details)

Uploaded Source

Built Distribution

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

seas8414_teach-0.1.1-py3-none-any.whl (42.6 kB view details)

Uploaded Python 3

File details

Details for the file seas8414_teach-0.1.1.tar.gz.

File metadata

  • Download URL: seas8414_teach-0.1.1.tar.gz
  • Upload date:
  • Size: 36.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.15

File hashes

Hashes for seas8414_teach-0.1.1.tar.gz
Algorithm Hash digest
SHA256 f5936f557a1467211c01fd5c6a377681a06e32d8d8772bfe33371b44c53d2dd7
MD5 9918ce39128b848a7e7e099e3b990eb9
BLAKE2b-256 e2514d272b3688fcee6ea6ddbd72c1c2c550198a003ef335555eaf2f01b35a73

See more details on using hashes here.

File details

Details for the file seas8414_teach-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: seas8414_teach-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 42.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.15

File hashes

Hashes for seas8414_teach-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 2d88a11e4ab5ba56c7dc3d32d2bb780612677bebb55d0e5540d55fdf2648a549
MD5 3248aa5a628a6e87108b22fa37987f7f
BLAKE2b-256 5aa6d64a04cb4db29e3ab69de5a85d6f0f5994edf488355ce3255b152cff99fb

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