Skip to content

PR to integrate FuzzIntrospector tool to FunctionAnalyzer agent #1074

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 30 commits into from

Conversation

AmPaschal
Copy link
Collaborator

@AmPaschal AmPaschal commented May 27, 2025

This PR does the following:

  • Implements an Agentic workflow for the function analyzer agent, comprising two agents invoked in sequence.
    • The first agent uses the FuzzIntrospector API tool to retrieve the source implementation of the target function and its children functions.
    • The second agent analyzes the retrieved function sources and extracts requirements on input arguments.
  • Implements and integrates the FuzzIntrospector tool, which uses the FuzzIntrospector API to retrieve a function's implementation, using either its signature or name.
  • Adds sample responses from the agent in the function-analyzer-result-sample directory.

Known Issues:

  • In a few occasions, the first agent (ContextRetriever agent) does not use the provided tool and instead, hallucinates the source code. I reduced the frequency of occurrence by specifying a very low temperature, but this still happens, albeit infrequently.
  • Sometimes, the ContextRetriever agent may not get the sources of all children functions called by the target functions. Hence, this may lead to missed requirements.

AmPaschal added 13 commits May 21, 2025 13:59
This commit includes the following tasks:
- implements a function analyzer agent using the ADK library.
- implements a function that gets a function's source using the FuzzIntrospector API.
- Provides this function as a tool to the function analyzer agent.
- Adds basic prompt templates for the agent.
- Creates a test file that can be used to access the agent independently.
…s not need to perform any operation while waiting for results from the agent.
This commit refactors the agentic workflow so that the function's source is retrieved deterministically and included in the agemt.

The prompts are also more specific on what requirements should be extracted.
First, the context retriever agent retrieves the source code of the function and its children for analysis.
Then, the requirements extractor agent
…raw result and the list of requirements.

The commit also updates function_analyzer_test to process multiple benchmarks in a provided file and write the results to a results file.

from google.adk.agents import Agent
from google.adk.agents import LlmAgent, SequentialAgent
Copy link
Contributor

Choose a reason for hiding this comment

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

Eh at google we generally import modules not classes. (except for types). I sort of disagree with the rule but we should do it for consistency.

Copy link

Choose a reason for hiding this comment

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

Okay, I have fixed all imports so we import modules, not classes.

@AmPaschal AmPaschal force-pushed the introspector-tool branch from c473906 to 47010af Compare May 28, 2025 13:42
@google google deleted a comment from pamusuo May 28, 2025
@AmPaschal
Copy link
Collaborator Author

/gcbrun -y ./benchmark-sets/all/astc-encoder.yaml

@AmPaschal
Copy link
Collaborator Author

/gcbrun exp -y ./benchmark-sets/all/astc-encoder.yaml

@AmPaschal
Copy link
Collaborator Author

/gcbrun exp -y ./benchmark-sets/all/astc-encoder.yaml -n pamusuo

AmPaschal and others added 8 commits May 29, 2025 18:52
It's a bit confusing we use CHAT for both chat and ask utility
functions. This changes so it's clear from the logging when each of them
is used.

Signed-off-by: David Korczynski <david@adalogics.com>
This PR mainly implements a crash analyzer that can interact with LLDB
in the multi-agent framework, and supports GPT. In addition, this PR
attempts to fix the problem of not replacing the fuzz target and build
script. This PR is under testing. The main logic is no longer changing,
and minor bugs are being fixed.

TODO:

Optimize the process of agent interaction with LLDB.
Solve the problem of missing debugging information for some projects.
Try to add LLM-based static methods to enhance the crash analyzer.

---------

Co-authored-by: Dongge Liu <donggeliu@google.com>
Fixing broken OSS-Fuzz projects is a common task and something we could
leverage OFG to do. This adds an initial agent-based approach for doing
this and it has already been used to fix
google/oss-fuzz#13389 and other projects
locally.

```
oss-fuzz-generator fix-build --project PROJECT_NAME --model ${MODEL}
```

---------

Signed-off-by: David Korczynski <david@adalogics.com>
- Works better with C/CXX
- Improve prompt writings
- Improve OSS-Fuzz build_fuzzers/check_build validation
- Improves code quality

---------

Signed-off-by: David Korczynski <david@adalogics.com>
Signed-off-by: David Korczynski <david@adalogics.com>
Signed-off-by: David Korczynski <david@adalogics.com>
@DonggeLiu
Copy link
Collaborator

/gcbrun exp -n pa -m vertex_ai_gemini-2-5-pro-chat -ag

@DonggeLiu
Copy link
Collaborator

@DonggeLiu
Copy link
Collaborator

Closing and reopening this PR to identify recent /gcbrun failure

@DonggeLiu DonggeLiu closed this Jun 5, 2025
@DonggeLiu DonggeLiu reopened this Jun 5, 2025
@DonggeLiu
Copy link
Collaborator

/gcbrun exp -n pa -m vertex_ai_gemini-2-5-pro-chat -ag

@AmPaschal
Copy link
Collaborator Author

/gcbrun exp -n pamusuo -m vertex_ai_gemini-2-5-pro-chat -ag

@AmPaschal AmPaschal closed this Jun 11, 2025
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.

6 participants