Skip to content

Add agent-first IP quality and fingerprinting - #73

Open
Svaag wants to merge 1 commit into
mainfrom
feat/ip-quality
Open

Add agent-first IP quality and fingerprinting#73
Svaag wants to merge 1 commit into
mainfrom
feat/ip-quality

Conversation

@Svaag

@Svaag Svaag commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Summary

  • add short-lived agentic network-check sessions with direct IPv4/IPv6 HTTPS, DNS, and STUN observations
  • add browser and agent fingerprint endpoints with explicit provenance, consent-gated high-entropy traits, and session-scoped identifiers
  • add a gated x402 IP-quality report using licensed providers plus RIPE and Team Cymru enrichment
  • expose the workflow through the Python SDK, MCP tools, discovery, skills, migration, and launch documentation

Why

Network integrity checks should run from the agent's own execution environment. A browser remains an optional adapter for browser-only signals such as WebRTC and high-entropy browser traits.

Impact and rollout

  • IP checks and paid IP quality remain disabled by default
  • the paid operation is absent from discovery until credentials, resale approvals, and margin controls pass
  • provider failures do not settle x402 payments
  • session credentials are stored as hashes and observations expire after at most 15 minutes
  • deployment requires migration 016 and the companion Web/infrastructure changes

Companion PRs

Validation

  • ruff check .
  • mypy hyrule_cloud — 100 source files
  • focused pytest suite — 25 passed
  • git diff --check origin/main...HEAD

@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: eba15e4474

ℹ️ 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 on lines +107 to +111
host = (request.url.hostname or "").lower()
if host == "v4.check.hyrule.host" and address.version != 4:
return JSONResponse(status_code=409, content={"error": "ipv4_probe_family_mismatch"})
if host == "v6.check.hyrule.host" and address.version != 6:
return JSONResponse(status_code=409, content={"error": "ipv6_probe_family_mismatch"})

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 Enforce probe family against configured probe hosts

When an operator overrides IP_CHECK_V4_PROBE_BASE_URL or IP_CHECK_V6_PROBE_BASE_URL, as these configuration fields explicitly allow, neither comparison matches and the endpoint accepts either address family. A v4 probe URL reached over IPv6 can then record an IPv6 address (and vice versa), making the advertised dual-stack result unreliable. Derive the expected hostnames from the active IP-check config instead of hard-coding the production defaults.

Useful? React with 👍 / 👎.

"accept_language": request.headers.get("accept-language"),
"sec_ch_ua": request.headers.get("sec-ch-ua"),
"sec_ch_ua_platform": request.headers.get("sec-ch-ua-platform"),
"tls_ja4": request.headers.get("x-hyrule-observed-tls-ja4"),

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 Do not accept client-supplied JA4 as server-observed

A caller can send X-Hyrule-Observed-Tls-Ja4 directly, and its arbitrary value is persisted and returned in header_traits with server_observed provenance. Unless every ingress path strips this request header and replaces it with a trusted proxy value, clients can forge this supposedly observed fingerprint evidence. Populate it from a trusted server-side integration or omit it when no trusted observation is available.

Useful? React with 👍 / 👎.

Comment on lines +132 to +137
async def run_ip_check_cleanup(
session_factory: async_sessionmaker[AsyncSession],
*,
interval_seconds: int = 60,
) -> None:
"""Continuously enforce the 15-minute retention ceiling."""

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 Keep the 15-minute retention promise at the maximum TTL

Sessions may be created with the configured 900-second maximum TTL, but physical deletion runs only once per 60 seconds. Consequently, an observation from such a session remains in the database for nearly 16 minutes, despite the documented and code-commented 15-minute retention ceiling. Run cleanup sufficiently before expiry or reduce the maximum session TTL by the cleanup interval.

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