AivexaNewsSearch
AI news for builders and product teamsChecked every hour

Build long-horizon agents with Grok 4.7 on Amazon Bedrock

Collected Oct 13, 2026

Amazon Bedrock now offers SpaceXAI's Grok 4.7, a model the provider says was trained to work longer on harder tasks and to check its own work. The AWS Machine Learning Blog paired the launch with a hands-on evaluation: a tool-calling agent built on Grok 4.7 and run against three search-style tasks, each with exactly one correct answer verified by brute force. Across six runs of each task at each of the model's four reasoning effort levels, the agent answered 67 of 72 runs correctly.

According to SpaceXAI, Grok 4.7 uses a larger base model than Grok 4.6 and was trained with a longer reinforcement learning run over a harder mix of tasks weighted toward problems that take many hours to complete. SpaceXAI also reports improvements in self-verification and longer-context handling. Its published benchmarks emphasize sustained work over single-turn answers: Terminal-Bench 4.0 rose from 20.3% to 37.6%, EEBench from 53.0% to 64.0%, the Harvey Legal Agent Benchmark from 15.8% to 19.6%, CursorBench 4.0 from 40.4% to 46.3%, and HealthBench Professional from 48.5% to 56.7%. On AA Briefcase v1.1 the score moved from 1,546 to 1,657. These figures are as published by SpaceXAI at launch.

The model is listed with a 500K token context window, text and image input, and text output. On Bedrock it supports configurable reasoning effort, tool calling, and structured output. It runs on the bedrock-runtime endpoint and is reached through a cross-Region inference profile rather than a bare model ID: us.xai.grok-4.7 for US data residency, or global.xai.grok-4.7 for commercial Regions where no residency constraint applies. Cross-Region inference spreads requests across multiple Regions to raise throughput without per-Region capacity management. The model works with the OpenAI-compatible Chat Completions and Responses APIs as well as Bedrock's Converse API, where reasoning arrives as a reasoningContent block beside the text block. Under Converse, only maxTokens goes in inferenceConfig; model-specific settings such as reasoning effort belong in additionalModelRequestFields.

Setup requires an AWS account with Bedrock model access enabled for Grok 4.7, Python 3.9 or later with openai, boto3 and aws-bedrock-token-generator installed, and configured credentials. The IAM identity needs bedrock:InvokeModel on both the inference profile and the account's default project, so both ARNs must appear in the policy. AWS recommends a short-term bearer token generated from existing credentials instead of a long-lived secret. One practical detail: reasoning tokens count as output tokens and consume max_completion_tokens before answer text is produced, so a limit hit mid-reasoning returns a response with no answer text. The evaluation used 32,768 tokens and left headroom at every level. Four effort levels exist (low, medium, high, xhigh); because these can shift between model versions, the post suggests probing the service for supported values rather than hardcoding them.

The test environment was synthetic: 20 services behind seven tools, with three tasks. Two-fault diagnosis asks the agent to find two services that failed silently at 03:00 among alerts from 12 others, with 190 possible pairs and one explaining the observed alerts. Maintenance scheduling patches eight services over four nights, two per night, under ten constraints plus a team rule requiring looked-up ownership data, with 2,520 possible schedules and one valid. Migration budgeting picks candidates maximizing risk reduction under a budget with transitive prerequisites, where 53 feasible sets exist and the best-ratio-first heuristic lands nine points short of optimal.

The measurement methodology is worth borrowing. Every rule the grader depends on is stated in the prompt, so edge cases cannot turn a reasonable answer into a wrong one. Each task's unique answer is proven by enumeration before any runs. Only a required final line, such as FINAL: auth, checkout, is graded, so reasoning can discuss alternatives without being penalized. Format is tracked separately from correctness, and tool parameters are constrained with enums so calls always target real resources. All 72 responses carried a gradeable final line.

Results by task were 5-6 of 6 at the lower levels rising to 6 of 6 at xhigh for two-fault diagnosis, 5 of 6 for maintenance scheduling until xhigh reached 6 of 6, and 5-6 of 6 for migration budgeting. Totals were 15 of 18 at low, 17 of 18 at medium and high, and 18 of 18 at xhigh. Mean output tokens climbed from 1,184 at low to 6,430 at medium, 6,778 at high, and 9,147 at xhigh, roughly 1.0x to 7.7x. Mean tool calls stayed nearly flat, between 17.2 and 18.7. Median elapsed time ran 18 seconds at low, 98 at medium, 89 at high, and 106 at xhigh.

Two readings stand out. Effort appears to change how much the agent reasons over gathered facts, not how much it explores, since tool use barely moved. And low offers a strong cost-to-quality ratio where a slightly lower completion rate is acceptable or answers get human review; high levels suit workflows needing first-time correctness. My own inference is that the token multiples, not the pass rates, are the more transferable number, because token prices shift while the ratio between effort levels tends to persist.

For production, the post recommends flagging runs by reasoning volume, since correct runs at medium and above each used at least 1,739 output tokens. A baseline of graded correct runs per task and effort level can trigger review when a run makes no tool calls or falls under a fifth of the lowest correct run's output. Effort is a per-request parameter, so planning and verification steps can run high while mechanical steps run low. Retries should be designed in with exponential backoff and jitter, honoring Retry-After on retryable statuses, and new high-volume workloads should ramp gradually. Invocation logging to Amazon S3 or CloudWatch Logs gives full transcripts; CloudWatch metrics aggregate token usage; AWS Cost Explorer and the Cost and Usage Report attribute spend per model. Flex and Priority service tiers are set per request, and the Global profile is typically priced lower per token than US geographic routing.

The stated limitations: six runs per task and level support direction but not confidence intervals, the synthetic tools omit real latency and error handling, runs lasted seconds rather than hours, and one model version, Region and prompt phrasing were used. Costs are reported in tokens, not currency.

Why it matters: teams building multi-step agents on Bedrock can now tune reliability against token spend with a per-request dial rather than a deployment-wide choice, which changes how they design planning and verification loops. The flat tool-call counts suggest effort buys deliberation on facts already gathered, not wider exploration, so agents that fail because they never look up the right value may not improve from a higher setting alone. Operational monitoring of output tokens per effort level looks like the cheapest way to catch degraded runs before their results are consumed. Benchmark and pass-rate figures come from a synthetic environment and small sample, so product teams should reproduce the measurement on tasks shaped like their own before fixing defaults.

Read at AWS Machine Learning Blog

Based on reporting from the original publisher. Visit the source for full context and later updates.

Publisher excerpt

Grok 4.7 is now available on Amazon Bedrock. In this post, we build a tool-calling agent on Grok 4.7 and evaluate it on three reasoning tasks at four reasoning effort levels, measuring correctness and token cost per completed task. We show how to tune the trade-off per request and monitor it in production.