Skip to content

feat: build secure PanMedia agent management console - #1

Merged
JAPStudios merged 2 commits into
mainfrom
feature/agent-management-console
Nov 7, 2026
Merged

JAPStudios merged 2 commits into
mainfrom
feature/agent-management-console

Conversation

@JAPStudios

Copy link
Copy Markdown
Owner

Summary

Replace the broken credential-bearing script with a working same-origin PanMedia management console. The new loopback Python server proxies a fixed allowlist of agent-management routes to Astrologically Intelligent. Its bearer token stays server-side. The browser can register agents, list them, pause or activate them, record heartbeats, execute prompts, create goals, request or decide approvals, plus manage budgets.

The console uses the existing Astrologically Intelligent orchestration database as its single source of truth. It does not create a second agent database. The proxy rejects arbitrary URLs, restricts query parameters, bounds request and response sizes, refuses non-HTTPS upstreams outside loopback, and blocks redirects so credentials cannot be forwarded to another host.

A standard-library unittest suite uses a local fake upstream service. A new GitHub Actions workflow runs Python compilation, proxy integration tests, plus Node syntax validation.

Dependency

The authenticated agent-management routes are being added to Astrologically Intelligent in PR #14. This PanMedia change validates the proxy against a deterministic fake upstream; it does not claim a live connection until that API change is merged.

Security

The previous public script contained a hard-coded API credential. The current source no longer contains that value. Its provider must revoke the credential because the old value remains in Git history.

Type of Change

  • New feature
  • Security hardening
  • Tests and documentation
  • Breaking change

How to Test

  1. Set ASTRO_AI_BASE_URL to the Astrologically Intelligent backend URL.
  2. Set ASTRO_AI_API_TOKEN to a server-side token containing at least 24 characters.
  3. Run python panmedia_server.py.
  4. Open http://127.0.0.1:7801/.
  5. Run python -m unittest discover -s tests -v.
  6. Confirm the browser source contains no API credential.

No live Astrologically Intelligent credentials are used by the tests.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 7, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-07T21:16:21.794109Z e26d875 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@JAPStudios
JAPStudios merged commit 5caf006 into main Nov 7, 2026
2 checks passed
@JAPStudios
JAPStudios deleted the feature/agent-management-console branch November 7, 2026 21:11

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e26d875d34

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread panmedia_server.py
data=body,
method=method,
headers={
"Authorization": "Bearer " + api_token,

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Authenticate callers before forwarding the server token

If the documented HTTPS reverse-proxy deployment is reachable without a separate authentication layer, any caller can invoke these proxy routes; PanMedia forwards requests with its privileged bearer token, including agent execution and approval decisions, without checking caller identity. Require authenticated access before forwarding, or explicitly require and document an authenticated proxy.

Useful? React with 👍 / 👎.

Comment thread script.js
const status = $("#agent-form-status");
try {
await api("/api/agents", "POST", payload);
event.currentTarget.reset();

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Save the form before awaiting the request

After await api(...), the event has finished dispatching and event.currentTarget is null, so this reset throws after the agent has already been registered; the catch reports failure and skips loadAgents(). The goal form repeats the same pattern at line 212, leaving the created goal unrefreshed as well. Capture the form element before awaiting.

Useful? React with 👍 / 👎.

Comment thread panmedia_server.py
def serve():
host = os.getenv("PANMEDIA_HOST", "127.0.0.1")
port = int(os.getenv("PANMEDIA_PORT", "7801"))
if host.lower() not in {"127.0.0.1", "localhost", "::1"}:

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Use an IPv6-capable server when accepting ::1

When PANMEDIA_HOST=::1, this check accepts the value, but ThreadingHTTPServer uses an IPv4 address family by default and fails to bind the IPv6 literal, preventing startup. Use an IPv6-capable server for this host or reject ::1 here.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant