Skip to content

fix(detector): detect setattr box replay#125

Closed
prasannakotyal wants to merge 1 commit into
gpu-mode:mainfrom
prasannakotyal:kg-blue-145-setattr-box-replay
Closed

fix(detector): detect setattr box replay#125
prasannakotyal wants to merge 1 commit into
gpu-mode:mainfrom
prasannakotyal:kg-blue-145-setattr-box-replay

Conversation

@prasannakotyal

Copy link
Copy Markdown

Summary

Targets KG red #145, where custom_kernel stores the first input-derived result on a module-level object through setattr, then returns that object attribute from a call-free fast path.

This adds a narrow SETATTR_BOX_REPLAY detector. It requires:

  • a module-level object created by a call
  • an entrypoint hasattr or attribute-read guard for that object attribute
  • a call-free replay body returning the same attribute, including getattr(obj, name)
  • a setattr(obj, name, <input-derived call>) or object.__setattr__(...) mutation of that same attribute
  • constant or module-level string attribute names

Normal object attribute use that computes from the current input, or attribute writes not feeding a replay return, stay out of scope.

KernelGuard-Red-Submission: 145

Local verification

  • red_26_setattr_box_replay -> SETATTR_BOX_REPLAY, should_filter=True
  • red_57_object_setattr_replay -> SETATTR_BOX_REPLAY, should_filter=True
  • red_145_dynamic_setattr_namespace_replay -> SETATTR_BOX_REPLAY, should_filter=True
  • clean fixtures in eval_blue_patch.py stayed valid
  • uv run python -m py_compile kernelguard.py

@prasannakotyal prasannakotyal temporarily deployed to kernelguard-api-control-plane May 1, 2026 23:50 — with GitHub Actions Inactive
@github-actions

github-actions Bot commented May 1, 2026

Copy link
Copy Markdown

KernelGuard Blue Evaluation

@SinatrasC

Copy link
Copy Markdown
Collaborator

Thanks for the KernelGuard Flywheel Campaign contribution. We are not merging this narrow variant separately because the consolidated rule-family implementation in #273 is the merge path for this detector area.

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.

2 participants